Hisham bin Amir reported,

On the day of Uhud, the people suffered great hardship, so the Prophet ﷺ said, "Dig the graves, make them wide, and bury two or three men in a single grave."They asked, "Messenger of Allah, whom shall we place first?"He replied, "Place first the one who knew the most of the Quran."

Nasai 2017

Sahih

أخبرنا محمد بن عبد الله بن المبارك قال حدثنا وكيع عن سليمان بن المغيرة عن حميد بن هلال

عن هشام بن عامر قال

لما كان يوم أحد أصاب الناس جهد شديد فقال النبي ﷺ احفروا وأوسعوا وادفنوا الاثنين والثلاثة في قبر فقالوا يا رسول الله فمن نقدم قال قدموا أكثرهم قرآنا

النسائي 2017صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Funerals
Chapter
Burying multiple people in a single grave
Numbering
Darussalam 2017
Nasai 2017