Salatul Janzah is Fard Kafayah, that is, if one prays the prayer than all are bareeuz zimma [free of the responsiblity] otherwise all those who received the news but did not come are sinners. Jammat is not a condition for this prayer, it is sufficient even if one person prays, and to deny the fardiat, compulsion, of this salah is kufr, an act of disbelief.
There are two parts of this Salah:
1) To say Allahu Akbar four times
2) Qayam which was three Sunnat Mukeda: Sana, Durood Shareef, and Duaa for the deceased
How to pray
Muqtadee should make the niyyat, “I make the niyyat for the prayer of this janaza for Allah, duaa for this deceased, behind this imam.” Now the Imam and muqtadee should raise their hands to their ears and fold their hands underneath the navel as usual whilst saying Allahu Akbar and read Sana, a slight difference is that after wa ta’ala jadduka one must read wa jalla sanauka wa laailaha gairuk. Then without raising the hands, say Allahu Akbar and read duroode Ibraheem; then without raising the hands, say Allahu Akbar and read the duaa. The Imam must say all the takbeer aloud whereas the muqtadee must say it slowly, the rest of the azkar (supplications) are to be read slowly by the Imam and Muqtadee. After the duaa, say Allahu Akbar and now drop the hands and then turn the head both sides for salaam.
Glory be to You Oh Allah, and praise be to You, and blessed is Your name, and exalted is Your Majesty, and there is none to be served besides You.
O Allah! shower Your mercy upon Muhammad and the followers of Muhammad , as You showered Your mercy upon Ibrahim and the followers of Ibrahim. Behold, Your are Praiseworthy, Glorious.
Oh Allah! Shower Your blessing upon Muhammad , and the followers of Muhammad as You showered Your blessings upon Ibrahim and the followers of Ibrahim. Behold, You are Praiseworthy, Glorious.
Duaa for an adult man or woman:
Oh Allah! Forgive those of us that are alive and those of us that are dead; those of us that are present and those of us who are absent; those of us who are young and those of us who are adults; our males and our females. Oh Allah! Whomsoever You keep alive, let him live as a follower of Islam and whomsoever You cause to die, let him die a Believer.
Duaa for a boy:
Oh! Allah, make him (this child) a source for our salvation and make him a source of reward and treasure for us and make him an intercessor for us and one whose intercession is accepted.
Duaa for a girl:
Oh! Allah, make her (this child) a source for our salvation and make her a source of reward and treasure for us and make her an intercessor for us and one whose intercession is accepted.
12 Ahkam of Janazah
1) Some people pray while wearing shoes and many people pray Janzah while standing on the shoes. If one prays wearing the shoes then it is necessary that the shoes and the earth underneath be pure and if one stands on the shoes then it is necessary that the shoes be pure.
2) There is more ihtiyat (care) that one does not pray while standing on the shoes. Stand on the earth, if you want you can stand upon your handkerchief.
3) It is necessary for the body of the deceased to be present; the janzah of the absent is not permissible
4) It is mustahab that the Imam stand in front of the chest of the deceased.
5) Several janzah maybe prayed at the same time; there is the option of putting the deceased in a row so that the chest of all is in front of the imam or in a line so that ones’ head is in line with the other’s feet and the others’ feet is in line with the others’ head. Wa ala hazal qayas (and presume the rest on this)
6) It is better to make three saf (rows) as it is mentioned in the Hadith that, “Whosevers’ salatul janzah was read by three saf, they will be forgiven.”
7) If there are, for example, seven people, then one should become the Imam, three people should stand in the first saf, two in the second saf, and one in the last saf (Guniyah)
8) In Janzah, the last saf is the best out of all the saf. [Durre Mukhtar] 9) Masbooq, one who missed some takbeer, should say the rest of his takbeer after the Imam says salaam, and he should say only the takbeer without the supplicatoins if he fears that people while start to give shoulder to the janzah before he finishes all the supplications. [Durre Mukhtar] 10) One can join the janzah even after the fourth takbber until the Imam has not said salaam. After the salaam of the Imam, he should say Allahu Akbar thrice (Duree Mukhtar) and say salaam.
11) The duaa for a boy or girl will be read for whoever died in a condition of madness in which they were born in or madness which occurred before puberty and lasted until death.
12) There is Gusul, Kafan, and Janzah for the child of a muslim whose akhtar (most) body had come out otherwise the child will be bathed, covered in sheet, and buried without gusul, kafan and salah. Akthar (most), from the head, means from the head to the chest; so there is no janzah for the child who was born crying from the head but passed away before the chest came out, and from the feet, akthar means from the feet to the back. A child born alive or dead will be given a name and on the day of Qayamat the child will be resurrected. (Durre Mukhtar, Raddul Muhtar)
The Order of Going with the Janzah Procession
1) It is an act of ibadat to give shoulder to a janazah
2) It is sunnat to give shoulder to all four legs ten steps each in such a manner that one shoulders the top head-right first, bottom leg-right second, then top head-left third, and then bottom-leg left last making a total of forty steps. It is in a Hadith Shareef that, “Whoever took the Janzah forty steps, his forty large sins will be forgiven.” It is also in a Hadith Shareef that, “Whoever shoulders all four legs, Allah will give him permanent magfirat (forgiveness).” [Alamgeeri] 3) There is no harm if one person holds a small child in his arms and people hold the deceased one after the other. [Alamgeeri] 4) It is not permissible nor allowed for ladies to go with the Janzah. [Bahare Shariat] 5) One should not return without praying the Janzah if he is with the Janzah, and he may return after the prayer with the permission of the awliyae mayyat and there is no need for permission after the burial. [Alamgeeri] 6) A husband may shoulder his wife’s janazah, lower it into the grave, and see the face. He may not give his wife gusul or touch her without anything between the body. The wife may give her husband gusul. [Bahare Shariat]
Rasaile Attariya by Allama Muhammad Illyas Attar Qadri