Rain is part of the water cycle. Although this process moves in a circle, I will start with evaporation. This is a process that enables the water molecules to get high up in the sky. The sun heats the earth's water sources. The water molecules on the surfaces of lakes, river, oceans, and other water sources heat up. These molecules transform from a liquid to a gas because of the heat and other properties in solar radiation. The evaporated water rises into the air. If this process seems odd to you, think about the grass in your yard on a summer day. A rain storm will leave the grass wet and the ground muddy, but a few hours in the summer sun will dry the ground quickly. That water doesn't just disappear. It evaporates back into the sky. The evaporated water molecules gather together around dust and other particulates in the atmosphere. When enough water has gathered, we start to see clouds. You might think of it like a drip in a faucet. The water clings to the spigot until there are enough water molecules there to cause a drip. It is similar with clouds. The water molecules cling together to dust and particulates until there are enough molecules to drip down. Of course, there are other factors that effect precipitation, but we will stick to the simplified version of the water cycle.
First of all the most vital element in our planet is water, wich can be in 3 forms,gas,solid(ice) and liquid (normal water).
As you might know there's a huge surface of water in our planet in the oceans,seas,rivers,lakes called the hydrosphere.Now the other vital element for our earth whcich keeps almost every single process going on is the sun,the sun is very hot because it's in inner part hydrogen atoms are fused to form helium,now the energy relased from this process is enormus,but this energy is in form ol light and heat.
This heat causes the water on our earth to evaporate and turn into steam,because the radius from atoms of water becomes larger it gives evaporated water the abbility to move up in the upper atmosphere.But since the upper parts of the atmosphere are colder water now truns back to tiny tiny drops of water,these drops of water connect with each other to form havier drops, when they can't resist the gravitational force or our earth they fall down.
This is How Rain is formed.