Praise be to Allaah.
The causes that make ghusl a must are:
1. The emission of semen, because the Prophet (peace and blessings of Allaah be upon him) said: "What requires water (ghusl) is if you see water (i.e., semen) coming out of you." (Reported by Muslim, no. 1/269)
2. Contact between the genitals, because the Prophet (peace and blessings of Allaah be upon him) said: "If one part enters the other part (in another report: if one part touches the other part), then ghusl becomes obligatory." (Reported by Ahmad and Muslim, no. 526) This ghusl is obligatory whether or not fluid (semen) is released. "touching" here refers to the entry of the tip of the penis into the vagina, not mere touching.
3. Menstruation and nifaas (post-natal bleeding), because Allaah says (interpretation of the meaning): ". . . And when they have purified themselves, then go in unto them as Allaah has ordained for you. . ." [al-Baqarah 2:222]; and because the Prophet (peace and blessings of Allaah be upon him) said to Faatimah bint Hubaysh, may Allaah be pleased with her: "When your period starts, stop praying, and when your period ends, perform ghusl then start praying again." (Reported by al-Bukhari, Fath, 309)
4. Death: the dead - apart from a martyr slain in battle - must be washed (ghusl), because when his daughter Zaynab died, the Prophet (peace and blessings of Allaah be upon him) said: "Wash her with water three or five times, or as many times as you see fit" (Reported by al-Bukhaari, al-Fath, 1175); and when a man who was in a state of ihraam was killed by his riding-beast, he said: "Wash him with water and lotus leaves and wrap him in his two garments, but do not embalm him or cover his head, for he will be raised on the Day of Resurrection pronouncing the Talbiyah." (Reported by al-Bukhaari, Fath, 1186)
There are other types of ghusl about which the scholars differed as to whether they are
obligatory, such as performing ghusl on Fridays, or whether a person who becomes Muslim
needs to perform ghusl upon entering the Faith.
There are types of ghusl which are encouraged, such as: ghusl on the two Eids; ghusl after washing a dead body; ghusl before entering the state of ihraam or entering Makkah; ghusl for a woman who is suffering from istihaadah (abnormal non-menstrual bleeding) before every prayer; ghusl after being unconscious; and ghusl after burying a mushrik. (Tamaam al-Minnah by al-Albaani, p. 120).
And Allaah knows best.