All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
One of the conditions for the validity of Ghusl of Janaabah (state of major ritual impurity) is to make sure that water reaches all of the outer surface of the body. The scholars underlined the ruling in this regard and cited the relevant evidence. An-Nawawi wrote:
"As for the intention and pouring water over the entire body in Ghusl, the scholars unanimously agreed that both are obligatory, without any difference of opinion among them. The evidence that water must reach all the hair and skin is the previously-mentioned hadeeth of Jubayr ibn Mut‘im, may Allah be pleased with him, about the description of the Prophet's Ghusl. This hadeeth explains the enjoined purification in the verse (which means): {And if you are in a state of Janaabah, then purify yourselves.} [Quran 5:6]" [Al-Majmoo']
The Hanafi scholar Al-Haskafi wrote, "It is obligatory to wash all that he can of the body once without burdening himself with undue hardship; so he washes the ears, navel, mustache, eyebrows, all parts of beard and hair as well, because the verse uses the hyperbolic form of the infinitive verb 'fat-tah-haroo' (meaning: purify yourselves extensively)." [Ad-Durr Al-Mukhtaar Sharh Tanweer Al-Absaar]
Thus, it becomes clear that one must wash between the buttocks given the general indication of the hadeeth (that water must reach the entire body surface). In fact, the obligation in this regard is more emphasized in the Ghusl of Janaabah because this is one of the hidden parts of the body that should be washed with care in Ghusl. Some scholars laid emphasis on washing hidden body parts in particular. The Maaliki scholar An-Nafraawi wrote, "He should wash his armpits and between his buttocks while their muscles are relaxed in order to wash the wrinkles of the anus. If he fails to do so, his Ghusl is invalid." [Sharh Ar-Risaalah]
As for washing underneath the fingernails and toenails, if there is nothing preventing water from reaching the skin underneath them, then it is not obligatory to clean them. If there is dirt preventing water from reaching underneath the nail, then the scholars held different views in this regard. Some held that it is obligatory to wash underneath the nails because it is part of the surface of the body that water must reach, while others held that it is excused.
The Kuwaiti Encyclopedia of Fiqh reads:
"If there is dirt under the nails preventing water from reaching underneath them, the Maaliki opinion and the favored view of the Hanafis is that such dirt does not invalidate the purification given the necessity and the fact that had it been obligatory to remove such dirt, the Prophet, sallallaahu ‘alayhi wa sallam, would have explained it. He, sallallaahu ‘alayhi wa sallam, criticized the men who visited him with dirt underneath their nails, indicating that the dirt emitted a smell. So he criticized them for the unpleasant odor, not for the invalidity of their purification. Had it been an invalidator of purification, this would have been more important to be made clear to them.
The opinion of the Hanbalis, which is also the less favored opinion of the Hanafis, and what is understood from the statements of the Shaafi‘is, is that purification is invalid until the dirt under the nails is removed because it is part of the hand that is hidden by something that is not a part of it and that prevents water from reaching the skin underneath it."
Allah knows best.