Room is being filled with water Suppose this setting:

There are two rooms separated by a closed wooden door. The door opens to the room A. Room A is being filled with water, which goes through the door into the room B. The water level is increasing faster in room A than in room B.
A person is trapped inside room B with the door as the only way to escape.
As far as I understand the physics, the person cannot open the door, because of the unbalanced water pressure (the same problem as being trapped in a car falling into a lake). I am not sure if he will be able open the door once the water level in room B reaches the top edge of the door – he would have to push against so much more water in room A... Could you please explain me the physics behind this scenario?
Is water going to fill the room B up to the ceiling, or is an air capsule going to appear from the top of the door up to the ceiling?
 A: Once the water level rises to the top of the door, it would continue to rise, compressing the air bubble at the top until the pressure of the air is at equilibrium with the pressure of the water below it.  So an air bubble would form, but it would slowly shrink as the water pressure outside continued to increase.  This is basically how liquid-filled barometers work.
As it reaches that point, though, the water pressure between rooms A and B should be fairly equal.  Your hero may need to kick the door pretty hard to get it open, but it should be manageable.
How sturdy is the door, though?  Your average interior door is relatively flimsy.  Assuming it doesn't just break under the pressure directly, your hero may be able to kick or break a hole in it, which would rapidly equalize the pressure between the two rooms and allow it to be opened.  They'd just need to be careful, since any debris would be forced back at them.
A: A lot depends at how high/tall the rooms are. If there is a difference in height (as in, room A is significantly taller than room B), it will be increasingly more difficult for the hero to open the door as water pressure would continue to pile up as water level rises in room A.
A water bubble will form at the top of room B, but as Salda007 has already explained, the bubble will get smaller and smaller in size (while the amount of air in the bubble remains the same). This will make it increasingly more difficult for the hero to breathe, as his lungs would be pressed with higher and higher force as water level rises.
Poking holes in the door will have its pros and cons. It will fill room B with water much quicker than it would have, otherwise (bad). But this will also mean that pushing open the door will be all that easier, as the hero would not have to fight against disproportionately higher pressure pushing the door inwards toward him. Generally I would suggest poking holes in the door only some time after the water level has risen above the door's top end. Reason being that not poking holes earlier (while water level is rising) keeps the possibility open that the pressure of water itself will break the door, in which case water would rush in and settle quickly. If that happens, the hero would have to be very careful not to get directly hit by the rushing water and be smashed into a wall. After the rushing wave is over, he can easily swim out of the door, provided that water pressure did break the door (possible, but not necessary).
Another possibility for the hero (beware: very dangerous course of action) is to actually pull the door toward him, instead of pushing it out. That way, the hero would be helping water break the door towards him. However, he ought to be very, very careful with this approach as in case of success, he will be thrown back toward the wall with a tremendous gushing wave. In case it is a small room, this water rush has the potential to kill him, as he is already pushing back himself.
A: It depends on how fast the water is entering Room B and how soon your character opens the door. Water pressure is a function of height as $h \rho g$, where $h$ is height of the water column, $\rho$ is density of water and $g$ is the acceleration due to gravity.
The force holding the door shut is the difference in pressure between the two sides times the cross sectional area of the door over which that is exerted, e.g., if the water level in Room A is $2m$ while in Room B it is $1m$, the pressure difference is $(2-1) \times 1000 \times 9.8 = 9800 Nm^{-2}$, exerted over $(2-1)m^2$ (assuming the door is $1m$ wide). The excess force exerted by the water column is therefore $9800Nm^{-2} \times 1 m^2=9800N \approx 1 Tonne$ of additional mass. The door therefore appears one tonne heavier.
On the other hand, if the water level in Room A is only $1 cm$ and only $1mm$ in Room B, the pressure difference is $0.01 \times 1000 \times 9.8 = 98Nm^{-2}$ and the force to overcome is only $98 \times (1 \times0.01)=0.98N$. I'm treating the marginal pressure of $1mm$ water as negligible.  
The other variable here is the relative rate at which the rooms are filling up. If the rate at which Room A fills up is a lot higher than the rate at which water flows between Room A and B, then, assuming the door is sturdy enough it will be nearly impossible to open until the pressure stabilises. If the flow rates are of similar magnitude, then the pressure difference is negligible, and the door can be easily opened.
Assuming that the trivial cases are ignored, i.e., assuming the flow rate into A is significantly higher than flow rate into B and the character does not open the door early enough, then, assuming nothing else is holding the door shut, the best thing to do is to try and pry the door open. If a wide enough gap is opened, even for a second, the force of the water flowing in to try and equalise pressure will force the gap wider and hold it open. Think of it as current flowing through two conductors in parallel: the current flow through the wider conductor is proportionately higher than the flow through the narrower one. Your character needs to crawl along the edge, where the speed of entering water is lowest, and he'll be out.
EDIT:had another idea while reading Youstay Igo's answer. Copying the comment I made, here:  
Poking a hole while the door is exposed has 2 advantages: 1) he can exert more force in air than in water; 2) the high pressure difference between the 2 sides of the door would force water though at high speed. If he is clever, he can make holes in a straight line along the middle of the door and the water coming through will tear the door apart like a page of stamps.
