For a reaction where R1 and R2 react to form P1 and P2, and the chemical equation of the reaction is: aR1 + bR2 <--> cP1 + dP2, the equilibrium constant expression is expressed as K = [P1]^c*[P2]^d/[R1]^a*[R2]^b
In the equilibrium constant expressions, the concentration of solids and pure liquids or solvents is not considered because it has been noticed that the concentration of the pure solid does not make a change in the concentrations of the ions or the species that exist in the gas phase. If a sufficient amount of solid is present for the other species that result from it to be present, the concentration of the solid is immaterial.
Similarly, the concentration of pure liquids and solvents is also not part of the equilibrium expression as their concentration is so high that during the reaction there is practically no change in it.
Equilibrium expressions use the molar concentration of reactants and products to calculate equilibrium constant. It is meaningless to consider concentration of a solid or a pure liquid so they are left out of the expression.