A condition for holding the ʿEid prayer is that it be performed by people who are permanent residents, living in houses erected with the customary building materials. The rule is the same as for the Friday prayer; hence the ʿEid prayer is conducted only in places where the Friday prayer may legitimately be held. Evidence for this is that when ʿEid coincided with the Prophet’s Farewell Pilgrimage, he did not perform the ʿEid prayer, nor did the caliphs after him while travelling.
The ʿEid prayer comprises two rakʿahs offered before the sermon. Ibn ʿUmar reported: “The Messenger of Allah ﷺ, Abu Bakr, ʿUmar, and ʿUthmān would perform the ʿEid prayers before the sermon.” Agreed upon. The Sunnah on this point is widely transmitted, and the majority of scholars act upon it. Al-Tirmidhī said, “This is the practice of the scholars among the Companions and those after them: the ʿEid prayer precedes the sermon.”
The reason the sermon follows the ʿEid prayer yet precedes the Friday prayer is that the Friday sermon is a prerequisite for the prayer itself, and a prerequisite must come before the act it conditions; the ʿEid sermon, by contrast, is recommended rather than obligatory.
Both ʿEid prayers are two rakʿahs by unanimous agreement. Al-Bukhārī and Muslim narrate from Ibn ʿAbbās that the Prophet ﷺ went out on the Day of Fiṭr, prayed two rakʿahs, and offered no prayer before or after them. ʿUmar declared: “The prayers of Fiṭr and Aḍḥā are two rakʿahs, complete and unshortened, as proclaimed by your Prophet ﷺ; whoever fabricates otherwise has failed.” Reported by Aḥmad and others.