Learning the math
There 8 players in the flop:
Hero is on the button and has 78offsuit
Everyone calls the $2 bet
The Flop comes 7KK rainbow
Everyone checks and the player in Middle position bets $12 and makes the pot $24,
Hero gets to work:
Hero determines that he has 5 outs(2 Sevens and 3 eights) and uses the rule of 4 and 2 and finds that he needs 20% to fall and he's getting 2:1 on his money and folds. Did I do this right?
This was done on Governor of Poker.
It's unnecessary to do any type of math here because there is no card on the turn that can come on the turn to give hero the lead in this hand. It's only necessary to calculate your outs vs pot odds if you're drawing to a strong/stronger hand. In this scenario, you aren't, so there is no need calculate anything. So, technically, yes, your fold was correct but only because you have a weak hand that has very little chance of improving to a better one. And with 8 players seeing the flop, there is a good chance one of them has at least a K.
To answer your question if the math was done correctly, you have the right idea, but not quite. It seems like you understand the rule of 2 and 4, but not exactly when to apply either one.
You would only use the rule of 2 in situations where:
-there is the possibility of future betting after each street. So, neither players are all in. This applies for flop-to-turn bets and turn-to-river bets.
You would only use the rule of 4 in situations where:
-there is no possibility of future betting. So, if a player is all in on the flop, they can no longer bet after the turn. So, if you call, you know you are guaranteed to see the turn and river without having to invest any more money.
Since you can see both turn and river, you can multiply by 4 to see your odds of hitting on either the turn or river. If they aren't all-in, you can only the turn and river one at a time and must calculate the odds of hitting first on the turn, and then on the river if your opponent bets out again after the turn.
If this is too confusing, just remember:
-Can my opponent bet out again after betting the flop and/or turn? If yes: Rule of 2.
-Can my opponent bet again after betting the flop? If no: Rule of 4.
Just FYI, you'll rarely use rule of 4, so stick with rule of 2 for most situations.
Finally, if we go back to your hand. MP bet out $12, making the pot $24. With your 5 outs, if MP still has money behind, there is a chance they can bet the turn. So, we would use rule of 2, giving you only about a 10% chance to hit on the turn. If MP was all-in, then the rule of 4 would apply and you would have closer to 20% to hit on either the turn or river.
Technically, you have 0 outs as mentioned above since you aren't drawing to a stronger hand, but for the sake of correcting your math, that's how you would do it.
Hope this helped.