The Messenger of Allah ﷺ said, "Complete the front row first, then the one behind it. Whatever shortage there is, let it be in the last row."
حدثنا محمد بن سليمان الأنباري حدثنا عبد الوهاب يعني ابن عطاء عن سعيد عن قتادة
أن رسول الله ﷺ قال أتموا الصف المقدم ثم الذي يليه فما كان من نقص فليكن في الصف المؤخر
[Sahih] Nasai narrated it in the Book of Leadership in Prayer, chapter on the rear row, no. 819, from the hadith of Saeed Ibn Abu Aruba through this route. Shuba followed him in narrating it, as recorded by Ibn Khuzayma, no. 1547, as did Abu Aban bin Yazid, as recorded by Ibn Hibban, no. 391. The hadith of Saeed was graded sahih by Ibn Khuzayma, no. 1546, and by Ibn Hibban, no. 390.