How should I make a player counter that ends game when there are 0 players on a team?

Here this should help you
[How do I end my bed wars map after a team has no players left. (I'm not good with block code) - #34 by The_Pro_Of_Pixels]
See post #35