When the Messenger of Allah ﷺ performed the ritual bath after major impurity, he would begin by washing his hands. Then he would perform ablution as he did for prayer. Next, he would run his fingers through his hair, and once he felt that he had thoroughly wetted the skin of his scalp, he would pour water over his head three times. After that, he would wash the rest of his body.
أخبرنا علي بن حجر قال حدثنا علي بن مسهر عن هشام بن عروة عن أبيه
كان رسول الله ﷺ إذا اغتسل من الجنابة غسل يديه ثم توضأ وضوءه للصلاة ثم يخلل رأسه بأصابعه حتى إذا خيل إليه أنه قد استبرأ البشرة غرف على رأسه ثلاثا ثم غسل سائر جسده