Praise be to Allah.
When is ghusl required?
The causes that make ghusl a must are:
- The emission of semen, because the Prophet (peace and blessings of Allah be upon him) said: "What requires water (ghusl ) is if you see water (i.e., semen) coming out of you." (Muslim, no. 1/269)
- Contact between the genitals , because the Prophet (peace and blessings of Allah 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." (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.
- Menstruation and nifas (post-natal bleeding), because Allah says (interpretation of the meaning): ". . . And when they have purified themselves, then go in unto them as Allah has ordained for you. . ." [al-Baqarah 2:222] The Prophet (peace and blessings of Allah be upon him) said to Fatimah bint Hubaysh, may Allah be pleased with her: "When your period starts, stop praying, and when your period ends, perform ghusl then start praying again." (Al-Bukhari, Fath, 309)
- 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 Allah be upon him) said: "Wash her with water three or five times, or as many times as you see fit." (Al-Bukhari, al-Fath, 1175) When a man who was in a state of ihram was killed by his riding-beast, he said: "Wash him with water and lote 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." (Al-Bukhari, 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.
When is ghusl recommended?
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 ihram or entering Makkah; ghusl for a woman who is suffering from istihadah (abnormal non-menstrual bleeding) before every prayer; ghusl after being unconscious; and ghusl after burying a mushrik. (Tamam al-Minnah by al-Albani, p. 120)
And Allah knows best.