If you’re idle on your system for five minutes, or more, Microsoft Teams will change the status. There isn’t any way to change this behavior. It is a feature so you can’t remove it but you can set a custom Available status and it will override it.
To override or block the Microsoft Teams away status from being set, follow these steps.
Note: if you lock your system, or it goes to sleep, your status will change to Away.