AddictiveTips published a tutorial about blocking the Microsoft Teams Away status.
How to block the Microsoft Teams Away status
If a user is signed into Microsoft Teams and the app is minimized while they work in a different app, the user's status will change from Available.

How to block the Microsoft Teams Away status