tf_gamerules has two outputs, Team1PlayersChanged and Team2PlayersChanged that fire whenever they change and send the number of players as a parameter. Then you can use those for whatever, or add them if you want total count.
If this is your first time logging in after the migration (Feb 8, 2022), you must reset your password to log in. Follow this guide if you're having trouble