Mishkat al-Masabih
He reported God’s Messenger as saying, "Complete the front row, then the one that comes next, and if there is any incompleteness let it be in the last row.” Abu Dawud transmitted it.
وَعَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «أَتِمُّوا الصَّفَّ الْمُقَدَّمَ ثُمَّ الَّذِي يَلِيهِ فَمَا كَانَ مِنْ نَقْصٍ فَلْيَكُنْ فِي الصَّفّ الْمُؤخر» . رَوَاهُ أَبُو دَاوُد
Reference