Thank you guys, now i have a question that is related to this one :
Lets say Player1 calls, Players2 raise, Players3 calls and player4 calls
then player1 re-raises and player2 folds, player 3 all in(because he doesnt match the amount of money that was rised and so creates a side pot) and player 4 calls.
Since player2 folds and has money in the pot...where does the money go...in the side pot or in the main pot?
You work it out the exact same way that I detailed above, by starting with the smallest stack that still has cards. If the player who raised then folded bet more than the size of the shortest stack before folding then the remainder goes into the next pot up and so on - the golden rule is that the shortest stack cannot win more from any one player than they started the hand with, even if that player that has since folded.
Let's do an example using the same stack sizes I had in the example above, and in this case assuming for simplicity's sake that Players 3 and 4 are in the blinds and there are no antes:
Player 1: $1000 at the start of the hand, holding AcKc
Player 2: $1000 at the start of the hand, holding QsQd
Player 3: $500 at the start of the hand, holding AsJd
Player 4: $250 at the start of the hand, holding ThTd
Player 1 open limps, Player 2 raises to $200, Players 3 and 4 both flat call, Player 1 then shoves, Player 2 folds because he's a nit and Players 3 and 4 call off the remainder of their stacks. You end up with two pots, as follows:
Main Pot: $950 (Player 4's $250, $250 each from Players 1 and 3 and the $200 that Player 2 bet before folding). Everybody (other than Player 2, who has folded) is eligible to win this one.
Side Pot: $500 (Player 3's remaining $250 and a matching $250 from Player 1). Only Players 1 and 3 can win this pot, and Player 1 gets the other $500 in his stack back since nobody matched it.
Flop comes down as above (2h 4s Tc 9s Ah). We award the side pot first, where Player 1's aces with a king beats Player 3's aces with a jack, and Player 1 takes the $500 side pot. We then move on to the main pot, where Player 4's set of tens beats Player 1's aces and Player 4 takes the $950 main pot.
If Player 2 bets more, however... here's another example, again assuming that Players 3 and 4 are in the blinds and there are no antes:
Player 1: $1000 at the start of the hand, holding AcKc
Player 2: $1000 at the start of the hand, holding QsQd
Player 3: $500 at the start of the hand, holding AsJd
Player 4: $250 at the start of the hand, holding ThTd
Player 1 open limps, Player 2 raises to $600, Players 3 and 4 call off their stacks, Player 1 then shoves, Player 2 folds because he's a really stupid nit and Players 3 and 4 are already all in. You still end up with two pots, as follows:
Main Pot: $1000 (Player 4's $250 and $250 each from Players 1, 2 and 3). Everybody (other than Player 2, who has folded) is eligible to win this one.
Side Pot: $750 (Player 3's remaining $250 and a matching $250 from Players 1 and 2). Only Players 1 and 3 can win this pot.
Player 1 gets his remaining $500 back,
plus the remaining $100 from Player 2's bet which nobody is left to challenge him for.
Then repeat the above process, 2h 4s Tc 9s Ah board, Player 1 wins the $750 side pot but Player 4 wins the $1000 main pot.
Does that cover it?