For a woman to pray in her house, or in the hotel, on her own or with other women who are there, is better and is preferable to her praying in al-Masjid al-Haraam or al-Masjid an-Nabawi, even though her praying in the mosque is permissible, because the Prophet (blessings and peace of Allah be upon him) said: “Do not prevent your womenfolk from going to the mosques, although their houses are better for them.” Narrated by Abu Dawood, 480; classed as saheeh by Shaykh al-Albaani (may Allah have mercy on him) in Saheeh Sunan Abi Dawood.
Imam Ahmad (25842) narrated that Umm Humayd, the wife of Abu Humayd as-Saa‘idi (may Allah be pleased with her) said: O Messenger of Allah, I love to pray with you. "O Messenger of Allah, I love to pray with you." He said: "I know that you love to pray with me, but praying in your house is better for you than praying in your courtyard, and praying in your courtyard is better for you than praying in the mosque of your people, and praying in the mosque of your people is better for you than praying in my mosque."
Classed as hasan by Shaykh al-Albaani (may Allah have mercy on him) in Saheeh al-Targheeb wa’l-Tarheeb
The ruling on the praying in the open areas and streets surrounding al-Masjid al-Haraam, and praying in the hotels overlooking al-Masjid al-Haraam, is based on the question of the worshipper following the imam from outside the mosque, which is a matter concerning which there is a scholarly difference of opinion. Some of the scholars regarded that as permissible, on condition that the worshipper can see the imam or those who are praying behind him. Others said that it is permissible to follow the imam on condition that the rows are continuous; if the rows are not continuous, then following the imam is not valid, even if it is possible to see the imam or those who are praying behind him.
An-Nawawi (may Allah have mercy on him) said: In order for following the imam to be valid, it is essential that he be able to know the movements of the imam, regardless of whether they both pray inside the mosque or elsewhere, or one of them is inside and the other is outside; and there is consensus on this point. Our companions said: he may be able to know that (the movements of the imam) by hearing the imam or those who are praying behind him, or seeing his actions or the actions of those who are praying behind him. They narrated that there was consensus on the permissibility of relying on any of these factors.
End quote from al-Majmoo‘, 4/202
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: The correct view concerning this matter is that in the case of those who are outside the mosque following the imam, it is essential that the rows be continuous; if they are not continuous then the prayer is not valid.
For example, around the Haram there are high-rise buildings in which there are apartments in which people pray whilst they can see the imam or worshippers praying behind him, either for the duration of the entire prayer or for part of it. According to the view of this author, their prayer is valid. We say to them: When you hear the iqaamah, then you can stay where you are and pray with the imam, and you do not need to come to al-Masjid al-Haraam.
According to the second opinion, their prayer is not valid, because the rows are not continuous. This view is the one which is correct.
End quote from ash-Sharh al-Mumti‘, 4/298
See also the answer to question no. 45611
If what is meant by women praying in the first rows is that they pray in front of the men in the same place, then this is contrary to the Sunnah, because the Sunnah is for the women to pray behind the men. But if that happens, the prayer is still valid.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: It may be noted that some men in al-Masjid al-Haraam form rows behind the women’s rows during the obligatory prayer; will their prayer be accepted? Do you have any advice to offer them?
He replied: If men pray behind women, some scholars say that there is nothing wrong with it, but this is contrary to the Sunnah, because the Sunnah is that the women should be behind the men. But, as we see in al-Masjid al-Haraam, the place is very crowded, so some women may come and form a row, then some men may come after them and form a row behind them. But worshippers should take care to avoid that as much as possible, because that may result in temptation to the men. So men should avoid praying behind women. Although this is permissible according to what the fuqaha’ have determined, we say that people should avoid this as much as possible, and women should also avoid praying in places close to men.
End quote from Majmoo‘ Fataawa Ibn ‘Uthaymeen, 13/19
But if what is meant by women praying in the first rows is that they are praying with other women, separate from men, this has been discussed previously in the answer to question no. 118155
With regard to women praying near men without a barrier, this is a matter concerning which the scholars differed. The majority are of the view that the prayer is valid, apart from the Hanafis who discussed the matter in more detail.
That has been discussed previously in the answer to question no. 79122.
And Allah knows best.