Taking a bath or ghusl is compulsory in Islam in the following cases:
Discharge of semen (janabat)
Menstrual discharge (haiz)
Vaginal bleeding for reasons other than menstruation or childbirth (Istihadah)
Postnatal bleeding (nifas)
It is mandatory to give the dead body a proper bath before it is buried. (mayyit)
If someone touches a human dead body, which has become cold and has not yet been given ghusl, then ghusl becomes compulsary. (Masse mayyit)
Wet dream (ahtelam)
Narrated Ali ibn AbuTalib (RA): Prophet Mohammad (s.a.w) said, “If anyone who is sexual defiled, leaves a spot equal to the breadth of a hair without washing, such and such an amount of Hell-fire will have to be suffered for it. Ali said: On that account I treated my head (hair) as an enemy, meaning I cut my hair. He used to cut the hair (of his head). May Allah be pleased with him. (Abu Dawud)
Narrated Hazrat Aishah (RA): "When the Prophet (s.a.w) took his bath after having sexual intercourse, he would begin by washing his hands. Then he would pour water from his right hand to his left and wash his sexual organs, make the ablution for prayer, take some water and put his fingers to the roots of his hair to the extent that he sees that the skin is wet, then pour water over his head three times and then over the rest of his body."
For complete information about the Islamic rules regarding ghusl, watch these videos of Imam sahib lest you make some mistake.
Keep Me In Your Prayers