There are two things which cause "janabat" and it is wajib to do ghusl of janabat after them:-
(a) Discharge of semen in sleep or while awake;
(b) Sexual intercourse. (both parties become junub).
Ghusl is wajib for all the things for which wudhu is required. Also, it is wajib to validate a sawm (fast), as will be explained later.
The following things are haraam if a person has to do GhusI janabat: (a) Reciting even a single
verse from those Surahs in which sajdah is wajib; Touching the writing of the Qur’an or the names of Allah, the Prophets, or the Imams (in any script}: (c) Entering any mosque. (If necessary, he/she may pass through the mosque without stopping for a single second). But so far as the Mosque of the Prophet, at Medina and Masjid al-Haram, at Mecca, are concerned, even passing through them is not allowed. (d) Putting anything into a mosque even from outside; and entering into a mosque to take out anything.
Note 1. The shrines of Imams are like the mosques in every detail.
For a person who has to do ghusl janabat, it is makruh to (1) read Quran more than seven ayats. (This applies to the Surahs in which no sajdah is wajib); (2) touch the Quran (not the writing, which will be haram); (3) take a Quran or carry it from one place to other, even without touching it.