How 2, 3 or more players will activate commands?

there are multiple ways you could do this, some are easier, some are more complicated.
All of these answers require you to join the players to their team if they press the button.


1. check for players without a team using redstone

this is the easiest solution. If you can assure that there will never be any more players than 4 (and any less than 2) in the world, you can use this method.

using the selector @a[team=] (in a testfor command for example) you can check for anyone that doesn't have a team. as soon as that number reaches 0 and the commandblock turns off, you can start your mechanism. for that you can just put a comparator next to this block and revert its output with a redstone torch.
Be aware that this means that if there is only one player on the server and he manages to get into a team, the game will start as well. so you either want to block off the buttons as long as there aren't at least 2 players or you can just check for a minimum of 2 players using the command

/testfor @a

and then taking the redstone output of a comparator to only power the other command if it's signal length is at least 2 (and at most 4, if you stop the signal from passing. it's possible, but not very room efficient and also laggy).


allright, those are the relatively easy possibilities using some commands and some redstone. but since we normally resort to not using redstone at all, here is the non-redstone and foolproof version.

2. count the actual players present in the world and then the ones in a team using the stats command.

this one requires some more complicated commands but no redstone and it is less prone to failure.

setup:

we'll need a few scoreboards for that

/scoreboard objectives add teamcount dummy
/scoreboard objectives add playercount dummy

as well as a scoreholder entity, i'll use an armorstand for this example, named "data":

/summon armor_stand ~ ~1 ~ {CustomName:"data",CustomNameVisible:1,NoGravity:1b,Marker:1b,Invulnerable:1}

then we'll need to initialise the scoreboard for the armorstand that we use in the stats later on:

/scoreboard players set @e[type=armor_stand,name=data] teamcount 0
/scoreboard players set @e[type=armor_stand,name=data] playercount 0

now onto the commandblocks:

first you'll have a commandblock that tests for all players present in the world

/testfor @a

we then use the /stats command to write the result of the testfor in the count scoreboard of the fake player #players (set , and to the coordinates of the first commandblock).

/stats block <x> <y> <z> set SuccessCount @e[type=armor_stand,name=data] playercount

then we testfor the amount of players that have a team, so we can check if the amount of players is correct.

/testfor @a[team=!]
    ↑
    /stats block <x> <y> <z> set SuccessCount @e[type=armor_stand,name=data] teamcount

voila, now we have the amount of players that are present in the world in the one objective and the amount of players that are in a team in the other.

now we just need a few execute commands to start the starting mechanism for each of the three possibilities:

/execute @e[type=armor_stand,name=data,score_playercount_min=2,score_playercount=2,score_teamcount_min=2,score_teamcount=2] ~ ~ ~ /<your starting command here>
/execute @e[type=armor_stand,name=data,score_playercount_min=3,score_playercount=3,score_teamcount_min=3,score_teamcount=3] ~ ~ ~ /<your starting command here>
/execute @e[type=armor_stand,name=data,score_playercount_min=4,score_teamcount_min=4,score_teamcount=4] ~ ~ ~ /<your starting command here>

Note: I changed the last command to execute if there are 4 or more players present in the world, so it will still start with 5 players in the world

Note2: these commands will now try to execute the starting command every gametick, so you might want to have something as the starting command that doesn't get reset every tick, like setting a redstone_block that only gets removed after the game is finished!

and there we go, that is how you make that happen.