It is narrated from Ibn Abbas (may Allah be pleased with him) that he said: The sun was eclipsed, so the Prophet (ﷺ) performed prayer. Ibn Abbas (may Allah be pleased with him) stated that his prayer was two rak‘ahs, and in each rak‘ah there were two bowings (ruku‘). Then he addressed the people and said: "The sun and the moon are two signs among the signs of Allah. They do not eclipse because of anyone’s death or life. So when you see this state in them, hasten to the remembrance of Allah."
Hadith Referenceمسند الإمام الشافعي / كتاب الكسوف / 539
Hadith Takhrijاخرجه البخارى الكسوف، باب صلاة الكسوف جماعة (1052) ومسلم ، الكسوف، باب ما عرض على النبي صلی اللہ علیہ وسلم في صلاة الكسوف من أمر الجنة والنار (907)۔