[Machine] Pray four units of prayer on the day of the festival in the mosque, two units for the Sunnah and two units for leaving the mosque. Al-Shafi'i also said that Ibn Mahdi narrated from Sufyan, from Abu Ishaq, that Ali ordered a man to lead a small group of people in prayer on the day of the festival in the mosque, two units, and likewise.
صَلُّوا يَوْمَ الْعِيدِ فِي الْمَسْجِدِ أَرْبَعَ رَكَعَاتٍ رَكْعَتَانِ لِلسُّنَّةِ وَرَكْعَتَانِ لِلْخُرُوجِ قَالَ وَقَالَ الشَّافِعِيُّ حِكَايَةً عَنِ ابْنِ مَهْدِيٍّ عَنْ سُفْيَانَ عَنْ أَبِي إِسْحَاقَ أَنَّ عَلِيًّا ؓ أَمَرَ رَجُلًا أَنْ يُصَلِّيَ بِضَعَفَةِ النَّاسِ يَوْمَ الْعِيدِ فِي الْمَسْجِدِ رَكْعَتَيْنِ وَكَذَلِكَ