notification when a user comes online

Yes, you can do this. Right-click on the contact and look for the item that says something like "Tag for status change alerts"


When using Microsoft Teams, you can use the Notify when available context menu option, but only when right-clicking on the person in the right place: the recent tab in the chat sidebar.

Demonstrate the "Notify when available" content-menu option in the chat sidebar

If you haven't chatted with that person recently, then you can start a chat with them, and then right-click on their name at the top of the list. As far as I can tell, this feature does not work when right-clicking on a person in any other location within the app, even on the same page.