Siddhartha was a prince. His parents did not let him go outside of the palace walls. His mother got a dream saying that if he goes outside the palace walls he will become a religious leader. If he stays he will become a king.
The prince was 29 when he ran outside the palace walls. He saw three things in his journey. A sick man, an old man, and a dead man were the three things that he found.
Soon, a man was sitting in a meditation pose. Siddhartha asked the man why was he so happy if there is so much pain and death in this world. The an replied that he was meditating to reach Nirvana.
For many days, Siddhartha sat on the Bod hi tree. He did what the man was doing- the meditation pose. He left everything behind, even his royal life, and tried to reach enlightenment.
He kept on trying and at one point he reach enlightenment.
After a few days of enlightenment, A snake god came and gave shelter to Buddha from the rain, from what the legend said.