Fiqh-us-Sunnah Volume 2, Supererogatory Prayer, Fiqh 2.148.

Section : Going out to the musalla (place of prayer).

Salatul ‘id can be performed in the mosque but it is preferred to perform in a place outside the city as long as there is no excuse or reason to do otherwise (e.g., rain and so on) as the Prophet would pray the two ‘ids in the outskirts of Medinah and he never prayed it in his mosque, except once and because it was raining.

Abu Hurairah reports that it was raining on the day of ‘id, so the Prophet led them in salatul ‘id in the mosque. This is related by Abu Dawud, Ibn Majah, and al-Hakim, and its chain contains an unknown narrator. Al-Hafiz says in at-Talkhis: “Its chain is weak,” and azh-Zhahabi asserts: “This hadith is rejected.”