Both men and women may wash the corpse of a child under seven years of age, whether the child be male or female. Ibn al-Munzir stated, “All the scholars whose opinions have reached us agree that a woman may wash a small boy.” The reason is that such a child possesses no ʿawrah (private area that must be covered) while alive, and the same applies after death; in addition, the Prophet’s son Ibrāhīm was washed by women.
Once the child reaches seven, the rule changes: a woman may not wash a boy of seven years or older, and a man may not wash a girl of seven years or older.
It is unlawful for a Muslim to wash a disbeliever, carry his bier, shroud him, perform the funeral prayer over him, or follow his funeral procession. Allah the Exalted says, “O you who believe, do not ally yourselves with a people on whom Allah’s wrath has descended” (Q 60:13). By its general wording, this verse forbids washing him, carrying him, or accompanying his funeral. Allah also says, “And never pray over any of them who dies, nor stand by his grave; indeed, they disbelieved in Allah” (Q 9:84), and He says, “It is not for the Prophet and those who believe to seek forgiveness for the polytheists” (Q 9:113).
Accordingly, a Muslim is not to bury a disbeliever either. If, however, no unbeliever is available to bury him, the Muslim may cover the body by dropping it into a pit, so as to prevent harm from the corpse—just as the slain at Badr were cast into the well. The same ruling applies to the apostate, such as one who deliberately abandons prayer or espouses a heresy that amounts to disbelief.