All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Ghusl Al-Janaabah (major ceremonial washing of the whole body after sexual intercourse) can be performed in two ways:
The first way is sufficient but not the better way. Here, the person has to pour water over his/her whole body including the roots of the hair and what is between the fingers and the like with the intention of purification from Janaabah (post sexual-intercourse impurity).
The second way is preferable as it fits what the Prophet Muhammad used to do as narrated by 'Aa'ishah and Maymoonah and is found in Al-Bukhari and Muslims collections of Hadeeth. This Ghusl is as follows: First, the person washes his/her private parts and then makes Wudhoo' (ritual ablution) as is usually done before prayers; then he pours water on his/her head three times such that the water gets to the roots of the hair. After that, the person pours the water over his/her whole body and finally washes his/her feet.
Rubbing the hair is not sufficient in both ways, as the water has to reach the scalp.
Allaah Knows best.