It is narrated from Sayyiduna Abu Hurairah, may Allah be pleased with him, that the Messenger of Allah, peace and blessings be upon him, said: "The best rows among the men are the first rows and the worst are the last rows, and among the women, the best rows are the last rows and the worst are the first rows."
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1303
Hadith Takhrijیہ حدیث اس سند سے حسن لیکن دوسری اسانید سے صحیح ہے۔ دیکھئے: [مسلم 441] ، [نسائی 819] ، [ابن حبان 2179] ، [الحمیدی 1030]
Brief Explanation
(Commentary on Hadith 1302)
The first row of men is the best because it is closest to the imam and farthest from the women, and the last row is the worst because it is far from the imam and close to the women. Similarly, the first row of women is worse because it is closer to the men, and the last row is better because it is farther from the men.
It should be noted that this is in the situation where there is no separate prayer area (musalla) for women and there is no barrier (hajiz) between the men and women.
By "better" and "worse" it is meant that the reward and merit of the first row of men is greater and that of the last row is less; similarly for the rows of women. This is because when men and women stand facing each other in the rows, Satan can cast whispers (waswasah) into the hearts.