It is reported from the Prophet ﷺ that he prayed during an eclipse. He recited, then bowed, then recited, then bowed, then recited, then bowed, then recited, then bowed, then prostrated. He said, "And the second rakah was like it."In another narration, the Messenger of Allah ﷺ, when the sun was eclipsed, prayed eight bowings within four prostrations. The same is reported from Ali.
عن النبي ﷺ أنه صلى في كسوف، قرأ ثم ركع، ثم قرأ ثم ركع، ثم قرأ ثم ركع، ثم قرأ ثم ركع، ثم سجد، قال: والأخرى مثلها. وفي رواية: صلى رسول الله ﷺ حين كسفت الشمس ثماني ركعات في أربع سجدات، وعن علي مثل ذلك.
Muslim narrated it in the chapter on the eclipse (909) through Yahya, from Sufyan, who said, Habib narrated to us, from Tawus, from Ibn Abbas, and he mentioned it. The second narration was reported by him (908) through Ismail bin Ulaya, from Sufyan, except for his statement, "eight rakats in four prostrations," which is shadhdh. Habib bin Abu Thabit, although among the trustworthy narrators, used to practice tadlis, and I have not found him mentioning that he heard this hadith from Tawus. It is possible that he took it from someone unreliable, from Tawus. Sulayman Ahwal narrated from Tawus, from Ibn Abbas, regarding his own action, that he prayed it as six rakats in four prostrations, thus differing from him both in attributing it to the Prophet and in the number. End of quote. Bayhaqi said this in Sunan al-Kubra (3/327).Ibn Hibban said, "The report of Habib bin Abu Thabit, from Tawus, from Ibn Abbas, that the Prophet ﷺ prayed eight rakats and four prostrations during the eclipse of the sun, is not sahih, because Habib did not hear this report from Tawus." Sahih Ibn Hibban (7/98).As for the hadith of Ali which Muslim alluded to, Imam Ahmad narrated it (1216) from Yahya bin Adam, Zuhayr narrated to us, Hasan bin Hurr narrated to us, Hakam bin Utayba narrated to us, from a man called Hanash, who said, The sun eclipsed, so Ali (meaning Ibn Abu Talib) led the people in prayer. He recited Ya-Sin or something similar, then bowed for about the length of a surah, then raised his head and said, "Allah hears whoever praises Him," then stood for about the length of the surah, supplicating and saying "Allahu Akbar," then bowed again for about the length of his recitation, then said, "Allah hears whoever praises Him," then stood again for about the length of the surah, then bowed again likewise, until he had prayed four rakats, then said, "Allah hears whoever praises Him," then prostrated, then stood for the second rakat and did as he had done in the first rakat, then sat supplicating and pleading until the sun cleared, then he told them that the Messenger of Allah ﷺ had done likewise.Ibn Khuzayma narrated it (1388) through Zuhayr, except that he did not give the full wording, but said at the end of the hadith, "In this report, he bowed four times in each rakat, like the report of Tawus from Ibn Abbas."I say, Hanash, that is, Ibn Mutamir Kufi, is disputed. Abu Dawud said he was trustworthy. Abu Hatim said, In my view he is acceptable. Ajli said, A trustworthy Follower. Nasai, Ibn Hibban, and others criticized him, and the summary regarding him, as Hafiz said, is "truthful but has lapses," meaning that he was truthful in himself but sometimes erred, and this is one of the things he erred in.Bayhaqi, based on treating the story as a single unified account, that the Prophet ﷺ prayed the eclipse prayer on the day his son Ibrahim died with two rakats, each rakat containing two bowings, said, "Whoever looks at this story, and at the story narrated by Abu Zubayr from Jabir, will know that it is one and the same story, and that the prayer he reported was performed on the day Ibrahim, the son of the Messenger of Allah ﷺ, died. The narrations of Urwa bin Zubayr and Amra bint Abdul-Rahman from Ayesha, the narration of Ata bin Yasar and Kathir bin Abbas from Ibn Abbas, the narration of Abu Salama bin Abdul-Rahman from Abdullah bin Amr, and the narration of Abu Zubayr from Jabir bin Abdullah, from the Prophet ﷺ, all agree that he prayed it as two rakats, with two bowings in each rakat. In most of their accounts, his statement on that day, 'The sun and the moon are two signs among the signs of Allah, they do not eclipse for anyone's death or life,' indicates that he only prayed it on the day his son died, and then he gave a sermon and said this statement to refute their claim that the eclipse occurred because of his death. The agreement of these narrators on this number, given the excellence of their memory, indicates that he never bowed more than twice in each rakat, contrary to what Shafii and Muhammad bin Ismail Bukhari held." End of quote. See Sunan al-Kubra (3/326).I say, this is also what Imam Ahmad held. Hafiz bin Qayyim said in his Zad (1/456), "What is reported from Ahmad is also that he adopted the hadith of Ayesha alone, with two bowings and two prostrations in each rakat. He said in the narration of Marwazi, 'I hold that the eclipse prayer is four rakats and four prostrations, with two rakats and two prostrations in each rakat, and I hold to the hadith of Ayesha, for most of the hadiths are on this.' This is the choice of Abu Bakr and the early companions, and it is the choice of our shaykh Abu Abbas Ibn Taymiya, who used to declare daif every hadith that contradicted it and say, 'They are mistaken, the Prophet ﷺ only prayed the eclipse prayer once, on the day his son Ibrahim died.' And Allah knows best." End of quote.A point of benefit, Imam Muslim opened the book on the eclipse with the hadith of Hisham bin Urwa, from his father, from Ayesha, in which it states that he ﷺ prayed four bowings in two rakats, and this is the most sahih account on the subject. He then listed the other hadiths to show the extent of the disagreement in determining the number of rakats, his purpose being to point out the flaws in these hadiths, the primary reliance being on the hadith of Ayesha and others, or else he held the view that it happened multiple times, which is untenable since the eclipse occurred only once during the Prophet's lifetime ﷺ. For this reason, Bukhari refrained from including these hadiths in his Sahih, because he held the view that any addition beyond two bowings in each rakat was a mistake made by some of the narrators.