The equilibrium expression for any chemical reaction can be determined if the phase of each substance that constitutes the chemical equation is known and the equation is balanced with the same number of atoms of each element on both the sides.
The equilibrium expression can be in terms of the concentration of each substance that makes up the equation or if there are gases involved it can be terms of the partial pressure.
For the equation given: 2H2 + O2<------->2H2O, the reactants as well as products are gases.
2H2(g) + O2(g)<------->2H2O(g)
The equation is balanced with two molecules of hydrogen reacting with a molecule of oxygen to give two molecules of water. The equilibrium expression is written in terms of the partial pressures of all the constituent compounds.
Kp = P(H2O)^2/P(H2)^2 * P(O2), where P(X) is the partial pressure of X and it is raised to the power equal to the number of molecules in the balanced chemical equation.