that the Prophet ﷺ said: “Whoever touches his private part, let him perform ablution.” (1) The anus is also a private part, because it is an opening from the interior of the body and that through which what is discharged exits.
Accordingly, ablution is invalidated by touching the anal ring. This is a subsidiary issue of the ruling on touching the penis, so one should refer back to that discussion to determine the stronger view on the matter. (2)
His statement, “the anal ring,” excludes touching what is near it, such as the buttocks—the two sides of the anus—or touching the buttock, the thigh, or the testicles; none of these invalidates ablution.
“Not the touching of hair or a nail, …”
His statement, “not the touching of hair,” means that touching the hair of someone whose touch would otherwise invalidate ablution does not invalidate it—for example, touching a woman lustfully, according to the madhhab.
An example is a man who lustfully touches his wife’s hair, but nothing is discharged from him: his ablution is not invalidated, because hair is treated as something detached. Just as touching her head covering does not invalidate his ablution, even lustfully, so too with her hair, since it is treated as detached and contains no life.
His statement, “or a nail,” means that if one touches the nail of someone whose touch invalidates ablution, his ablution is not invalidated. (3)
For example, if a man lustfully touches his wife’s nail, his ablution is not invalidated, whether the nail is long or short.
The same applies to a tooth: if he touches it lustfully, his ablution is not invalidated, because it is treated as something detached; it has neither life nor sensation.