It is narrated from Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Shall I not tell you of something by which Allah Almighty wipes out sins and increases good deeds?" The Companions (may Allah be pleased with them) said: Certainly, O Messenger of Allah (peace and blessings be upon him)! Please tell us. He (peace and blessings be upon him) said: "Performing ablution fully and well at times of difficulty, walking often to the mosques, and waiting for the next prayer after a prayer. Whoever among you leaves his house having performed ablution, prays in congregation, and then waits in the mosque for the next prayer, the angels say: 'Allahumma ighfir lahu, Allahumma irhamhu' (O Allah, forgive him; O Allah, have mercy on him). So when you stand for prayer, straighten and align your rows and do not leave gaps in between, for I see you even from behind my back. When your imam says 'Allahu akbar', say 'Allahu akbar'; when he bows, bow; and when he says 'Sami' Allahu liman hamidah', say 'Allahumma rabbana wa laka al-hamd'. The best rows of men are the first and their worst are the last, and the best rows of women are the last and their worst are the first." "O women! When the men prostrate, lower your gaze, so that your eyes do not fall upon the men's private parts because of their short (tight) lower garments."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2265