with cteTest (RowNum, EmpID, LogTime)
as
(
select ROW_NUMBER() OVER(PARTITION BY EmployeeID ORDER BY LogTime ASC),
EmployeeID,
LogTime
from #Test
)
select cc.EmpID,
cc.LogTime
from cteTest cc
left join cteTest cp
on cp.EmpID = cc.EmpID
and cp.RowNum = cc.RowNum - 1
where DATEDIFF(ss, coalesce(cp.LogTime, '01/01/01'), cc.LogTime) > 120
order by cc.EmpID, cc.LogTime