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: 2HF<------->H2 + F2, the reactants as well as products are gases.
2HF(g)<------->H2(g) + F2(g)
The equation is balanced with two molecules of hydrogen fluoride at equilibrium with one molecule of hydrogen and one molecule of fluorine. The equilibrium expression is written in terms of the partial pressures of all the constituent compounds.
Kp = P(H2)*P(F2)/P(HF)^2, 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.