Ibn Hubayrah reported that the Messenger of Allah ﷺ said, "No Muslim dies and three rows of Muslims pray over him except that it becomes guaranteed for him."Whenever Malik found the funeral attendees to be few, he would arrange them into three rows, acting upon this hadith.
حدثنا محمد بن عبيد حدثنا حماد عن محمد بن إسحق عن يزيد بن أبي حبيب عن مرثد اليزني
بن هبيرة قال قال رسول الله ﷺ ما من مسلم يموت فيصلي عليه ثلاثة صفوف من المسلمين إلا أوجب قال فكان مالك إذا استقل أهل الجنازة جزأهم ثلاثة صفوف للحديث
[Isnad daif]. Tirmidhi transmitted it in the Book of Funerals, Chapter on how the funeral prayer is performed and interceding for the deceased, no. 1028, and Ibn Majah, no. 1490, from the hadith of Muhammad bin Ishaq bin Yasar through this route. Tirmidhi said, "Hasan," and Hakim graded it sahih, 1/362-363, and Dhahabi agreed with him. Muhammad bin Ishaq used the ambiguous form "an" in his transmission, and the hadith has another defect that undermines it.