The scholars agree that the prayer of the eclipses is a confirmed sunnah which is to be performed by both men and women. It is recommended to pray it in congregation although the congregation is not a condition for it. The sunnah is to be performed in a mosque as the Prophet (peace be upon him) went to the mosque immediately after the solar eclipse appeared. It’s also permissible for women to attend the congregation of the solar and lunar eclipse as `A’ishah and Asmaa bint Abi Bakr (may Allah be pleased with them) prayed with the Prophet at the mosque.
The people are called to it by announcing As-Salatu jami`ah “prayer in congregation.” The majority of the scholars hold that it is to consist of two rak`ahs (unit of prayer)and that in every rak`ah one is to perform two bowings (ruku`) instead of the customary one.
`A’ishah narrates: “There was a solar eclipse during the time of the Prophet (peace be upon him)and the Prophet went to the mosque, and he stood and made the takbir (saying Allah is greatest), and he put the people in rows behind him, and he made a lengthy recital during the Prayer. Next, he made the takbir and made a long bowing, but it was not as long as the recital. Following that, he raised his head, saying: ‘Allah hears him who praises Him. And to You, our Lord, belongs the praise.’ Afterward, he stood and made another long recital but it was shorter than the first one. Again, he made the takbir and made a bowing that was shorter than the first one. Then, again he said: ‘Allah hears him who praises Him. And to You, our Lord, belongs the praise.’ After this, he prostrated. He did the same in the next rak`ah and finished four bowings and four sujud (prostration). The sun appeared again before he finished. Finally, he stood and addressed the people and praised Allah as He deserves it and said: ‘The sun and the moon are two signs from among Allah’s signs and there is no eclipse due to someone’s death or life. If you see them occurring, hurry to pray.’” (Al-Bukhari and Muslim)
Ibn `Abbas (may Allah be pleased with him) said: “There was a solar eclipse during the life time of the Prophet (peace be upon him) and he prayed with a long standing, similar to what it takes to recite Surat Al-Baqarah. Then, he made a long bowing. After which, he stood and made another long recital but shorter than the first one. Again he went into bowing, but for a shorter time than in the first one. Following this, he made sajdah [twice]. Next he made another long standing (qiyam) which was also not as long as the first. After that, he made another lengthy bowing but it was not as long as the first one. Again, he made another long standing [and recital] but it was not as long as the first one. After which, he made another lengthy bowing but it was not as long as the previous one. Following this, he went into prostration [and so on]. When he had finished, the sun had appeared. He concluded his prayer and said: ‘The sun and the moon are two signs from the signs of Allah, and there is no eclipse due to the death or life of anyone. If you see it, make remembrance of Allah.’” (Al-Bukhari and Muslim)
Imam Ibn Al-Qayyim observes: “The authentic, clear, and considered sunnah concerning salat Al-khsuf is that the bowing is to be repeated [twice] in every rak`ah. This is based on the hadith from `A’ishah, Ibn `Abbas, Jabir, and others.
They all report that the Prophet repeated the bowing in one rak`ah. Those who mention the repeating of the bowing are more in number, weightier, and closer to the Prophet than those who do not mention it.” This is the opinion of Malik, Ash-Shafi`i, and Ahmad.
Abu Hanifah is of the opinion that salat Al-Khusuf consists of two rak`ahs, similar to salat Al-`Eid and jumu`ah, based on the hadith of An-Nu`man ibn Bashir (may Allah be pleased with him) who says: “The Messenger of Allah (peace be upon him) prayed Salat Al-khusuf with us like one of your prayers. He went into bowing and performed prostration, praying two rak`ahs by two rak`ahs, and supplicated to Allah until the sun reappeared clearly again.” In the hadith from Qabsah al-Hillali, the Prophet said: “If you see that [i.e., an eclipse], pray as you pray the obligatory prayer.” (Ahmad and An-Nasa’i)
The reciting of Surat Al-Fatihah is obligatory in each rak’ah, and one may recite whatever one wishes to, after Al-Fatihah. It is allowed to make the recital audible or silent, but Al-Bukhari says: “Audible recital is more proper.”
Source: Quoted with slight modifications from Sayyid Sabiq’s Fiqh As-Sunnah.Soucre Link