Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) reports this saying of the Prophet (peace and blessings be upon him): "Shall I not guide you to that by which Allah Almighty wipes out sins and increases good deeds?" The people said: "Yes, indeed!" The Prophet (peace and blessings be upon him) said: "Performing ablution thoroughly at times when it is difficult for oneself, taking many steps walking to the mosques, and waiting for one prayer after another prayer. The angels say: 'O Allah, forgive him; O Allah, have mercy on him.'" The Prophet (peace and blessings be upon him) said: "When you stand for prayer, straighten your rows, set them right and fill the gaps, for I see you behind my back as well. When the imam says 'Allahu akbar', you also say 'Allahu akbar'; when he bows, you also bow; and when he says 'Sami'a Allahu liman hamidah' (Allah hears the one who praises Him), you say 'Allahumma rabbana laka al-hamd' (O Allah, our Lord, to You belongs all praise)." The Prophet (peace and blessings be upon him) also said: "The best row of the men is the first one and the least good is the last one, and the best row of the women is the last one and the least good is the first one." (Allamah al-Haythami says:) I say: Imam Ibn Majah recorded part of this narration.
Imam al-Bazzar recorded it; its chain contains a narrator, Abdullah bin Muhammad bin Aqil, about whom there is criticism. Imam Ahmad also recorded it as a complete narration, and Imam Abu Ya'la recorded it in abridged form; this narration has already passed.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2804