Because there are 4 P on the right side, we have to put a coefficient of 4 on the left to balance out the P.
This would give us 12 H on the left and 2 H on the right, so we have to put a 6 on the right to balance out the H.
Now we have 16 O on the left and 2 on the right, so a coefficient of 8 is required to balance out the O.