Checking whether users are logged in or out

How can I get the status of which users are currently logged in and which are not?

Thank You.