At certain altitude, the temperature of air decrease, The air becomes saturated and water vapour molecules starts condensing.
As the altitude of air increase, the atmospheric pressure decrease due to which the temperature of the air decrease. The water molecules in the atmosphere start condensing, which saturate the air (that is air can no hold water molecules), due to which the water vapour molecules starts condensing and falls on the earth in the form of rain.