It is obligatory to offer Namaz-e-Mayyit for every Muslim, as well as for a Muslim child if it has completed 6 years of its age.
If a child had not completed 6 years of its age, but it was a discerning child who knew what Namaz was, then as an obligatory precaution, Namaz-e-Mayyit for it should be offered. If it did not know of Namaz, then the prayers may be offered with the Niyyat of 'Raja'. However, to offer Namaz-e-Mayyit for a still born child is not Mustahab.
Namaz-e-Mayyit should be offered after the dead body has been given Ghusl, Hunnut and Kafan and if it is offered before or during the performance of these acts, it does not suffice, even if it is due to forgetfulness or on account of not knowing the rule.
It is not necessary for a person who offers Namaz-e-Mayyit to be in Wudhu or Ghusl or tayammum nor is it necessary that his body and dress be Pak. Rather there is no harm even if his dress is a usurped one. However, it is better that while offering this Namaz one should observe all the formal rules which are normally observed in other prayers.
One who offers Namaz-e-Mayyit should face the Qibla, and it is also obligatory that at the time of Namaz-e-Mayyit, the dead body remains before him on its back, in a manner that its head is on his right and its feet on his left side.
As a recommended precaution, the place where a man stands to offer Namaz-e-Mayyit should not be a usurped one, and it should not be higher or lower than the place where the dead body is kept. However, its being a little higher or lower is immaterial.
The person offering Namaz-e-Mayyit should not be distant from the dead body. However, if he is praying in a congregation, then there is no harm in his being distant from the dead body in the rows which are connected to each other.
In Namaz-e-Mayyit, one who offers prayers should stand in such a way that the dead body is in front of him, except if the Namaz is prayed in Jama'at and the lines extend beyond on both sides, then praying away from the dead body will not be objectionable.
As a precaution, there should be no curtain or wall or any other obstruction between the dead body and the person offering Namaz-e-Mayyit. However, there is no harm if the dead body is in a coffin or in any other similar thing.
The private parts of the dead body should be concealed when Namaz-e-Mayyit is being offered. And if it was not possible to give Kafan, even then at least its private parts should be covered with a board or brick or any similar thing.
A person should be standing while offering Namaz-e-Mayyit and should offer it with the Niyyat of Qurbat, specifying the dead person for whom he is praying. For example, he should make his intention thus: "I am offering Namaz for this dead person in compliance with the pleasure of Allah".
If there is no one who is capable of praying Namaz-e-Mayyit while standing, then it can be offered while sitting.
If the deceased had made a will that a particular person should lead the prayers for him the recommended precaution is that such a person should take permission from the guardian of the dead person.
It is Makrooh to repeat Namaz-e-Mayyit a number of times, unless the dead person was an Aalim and pious one, in which case it is not Makrooh.
If a dead body is buried without Namaz-e-Mayyit, either intentionally or forgetfully, on account of an excuse, or if it transpires after its burial that the prayers offered for it was void, it will not be permissible to dig up the grave for praying Namaz-e-Mayyit. There is no objection to praying, with the Niyyat of Raja', by the graveside, if one feels that the decay has not yet taken place.
Method of Namaz-e-Mayyit
There are 5 takbirs (saying Allahu Akbar) in Namaz-e-Mayyit and it is sufficient if a person recites those 5 takbirs in the following order:
It is, however, better that he should pronounce the following supplications after the takbirs respectively:
A person offering prayers for the dead body should recite takbirs and supplications in a sequence, so that Namaz-e-Mayyit does not lose its form.
A person who joins Namaz-e-Mayyit to follow an Imam should recite all the takbirs and supplications.
Mustahab Acts of Namaz-e-Mayyit
The following acts are Mustahab in the prayers for the dead body:
A person who offers prayers for the dead body should have had Ghusl or performed Wudhu or tayammum. And the precaution is that he should perform tayammum only when it is not possible to do Ghusl, or Wudhu, or if he fears that if he goes for Ghusl or Wudhu it will not be possible for him to participate in the prayers.
If the dead body is that of a male the Imam or a person who is offering the prayers alone should stand at the centre of its height, that is, the middle part of the dead body, and if the dead body is that of a female he should stand at the chest of the dead body.
To pray bare-footed.
To raise one's hands (up to the ears) while pronouncing every takbir.
The distance between the person offering prayers and the dead body should be so short that, when the wind blows, the dress of the person offering the prayers would touch the coffin.
To pray in congregation.
The Imam to recite the takbirs and supplications loudly and those offering the prayers with him to recite them in a low voice.
If there is only one person joining the Namaz-e-Mayyit being offered in Jama'at, he would stand behind the Imam.
One who offers the prayers should earnestly and persistently pray for the dead as well as for all the believers.
Before the commencement of the congregational prayers for the dead body one should say "as-Salat" three times.
The prayers be offered at a place where people often go for Namaz-e-Mayyit.
If a Haaez (woman in her menses) participates in the congregational prayers for a dead person, she should stand alone and should not join the lines.
It is Makrooh to perform prayers for dead bodies in masjids, except in Masjidul Haram.