hi, my professor ask us to create a program that has auto logout feature after 2mins or set my own time to logout, after the user logged in to the machine, if ever he or she left it without pressing the logout after 2 mins of being idle or standby it will return to the login screen. Help me please ! im using vb6

You need to capture keyboard and mouse events and use Timer.
Reset the timer on each user interaction (keyboard and mouse events).

my professor ask us to create a program that has auto logout feature after 2mins or set my own time to logout, after the user logged in to the machine,

just add one timer and set interval to 1000 and then write the following code :-

Private Sub Timer1_Timer()
Static i As Integer
If i = 120 Then Unload UserForm : Login.Show: Exit Sub
i = i + 1
End Sub

hope this helps you.