Fiqh-us-Sunnah Volume 4, Funerals and Dhikr, Fiqh 4.045.

Section : Three Rows for a Funeral Prayer are Commended.

It is recommended that the people should make three rows (The minimum number of people for a row is two persons) while offering a funeral prayer, and that these rows should be straight. This is based on a report from Malik ibn Habairah who said: “The Prophet, peace be upon him, said: ‘Every believer who dies is forgiven by Allah if a group of Muslims comprising three rows prays for him’.” That is why, if there were not many people attending a funeral prayer, Malik ibn Habayrah would make them stand in three rows. This is narrated by Ahmad, Abu Daw’ud, Ibn Majah, Tirmizhi, and Al-Hakim, who considers it a sound hadith.

Ahmad said: “If the number of people present at the funeral prayer is very small I would still prefer that they make three rows.” He was asked: “What if there are only four people present?” He replied: “They may make two rows, with two persons in each line.” He did not like three rows with each of them consisting of only one person.