We were with the Messenger of Allah ﷺ when the sun was eclipsed. The Prophet ﷺ rose, dragging his cloak, until he entered the mosque. We entered with him, and he led us in two units of prayer until the sun became clear again.Then the Messenger of Allah ﷺ said, "The sun and the moon are not eclipsed for anyone's death. When you see them eclipsed, pray and supplicate until what afflicts you is removed."
كنا عند رسول الله ﷺ فانكسفت الشمس، فقام النبي ﷺ يجر رداءه حتى دخل المسجد، فدخلنا، فصلى بنا ركعتين حتى انجلت الشمس، فقال رسول الله ﷺ: إن الشمس والقمر لا ينكسفان لموت أحد، فإذا رأيتموهما فصلوا، وادعوا حتى يكشف ما بكم.
Bukhari reported it in the Book of the Eclipse (1040) from Amr bin Awn, who said, Khalid narrated to us from Yunus, from Hasan, from Abu Bakra, and he mentioned it. Bukhari also reported it (1048) through the route of Hammad bin Zayd, from Yunus, from Hasan, from Abu Bakra, adding to it, "But Allah the Exalted uses it to warn His servants." He said, Musa followed him, from Mubarak, from Hasan, who said, Abu Bakra informed me, from the Prophet ﷺ, "Allah uses the two of them to warn His servants."His statement, "he led us in two rakahs," means along with four bowings, because Abu Bakra was among those who were present at the eclipse prayer. It has been established in the previous narrations that it is prayed as two rakahs like the rest of the voluntary prayers, but with four bowings.