Let me simplify it first - warm air turns the water from rivers, lakes, and oceans into water vapor that rises into the air. That water vapor forms clouds, which contain small drops of water or ice crystals. When the water vapor in the cloud becomes too heavy, it falls back to the ground as rain or snow.
Now let’s get into a detailed explanation. When warm, wet air rises, it cools, and water vapor condenses out to form clouds. As said above, cloud is made up of small drops of water or ice crystals, depending on its height and how cold is the surrounding air. Height and temperature also determine whether any ‘precipitation’ (Latin for 'to fall from') will be rain or the hail associated with thunderstorms, or the snow, or the sleet and freezing rain.
To form rain, water vapor needs a ‘condensation nucleus’, which can be tiny particles of dust, or pollen, swept up high into the atmosphere. When the condensing droplets that form the cloud get large and heavy enough to overcome the upward pressure of convection, they begin to fall. If the temperature all the way to the ground is above freezing, then, it ‘rains’! And when ice crystals form high up in the cloud, and it's below the freezing point of water all the way down, then you get snow.
Thus, rain and snow are the two sides of the same coin!