Ruling on one who catches up with the tashahhud with the imam in Eid prayer or prayers for rain
Question

What is the ruling on one who catches up with the tashahhud with the worshippers in Eid prayer or prayers for rain? Does he have to pray two rak’ahs as the imam did or what should he do?.
Praise be to Allah.If a person catches up with the tashahhud only with the imam in Eid prayer or prayer for rain, he should pray two rak’ahs after the imam says the salaam, doing in them as the imam did of takbeer, recitation, bowing and prostrating. 
And Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and Companions. End quote.