The setup for this requires the use of a few more commands.
First, setup a scoreboard to keep track of how many players are on a team at a given time.
/scoreboard objectives add playerCount dummy
Then, on a repeating command block, store the result of the list of the players on the team to the scoreboard.
/execute store score players playerCount run team list player
Finally, run the command on a repeating command block to test for only one player on a team.
/execute if score players playerCount matches 1 run [Your tp command here]The setup for this requires the use of a few more commands.
First, setup a scoreboard to keep track of how many players are on a team at a given time.
/scoreboard objectives add playerCount dummy
Then, on a repeating command block, store the result of the list of the players on the team to the scoreboard.
/execute store score players playerCount run team list player
Finally, run the command on a repeating command block to test for only one player on a team.
/execute if score players playerCount matches 1 run [Your tp command here]
Also, keep in mind that if kept on the "player" team, the one player at the end will continuously teleport to that location.