Sayyiduna Anas (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "Complete the front row first, then the second row; and if there is any shortfall, let it be in the last row."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 5190