Need help with my teams

Im making a gamemode and I was wondering if someone could tell me how to make it that you must be team1 before becoming team2