The Prophet ﷺ said, "The sun and the moon do not eclipse because of someone's death or life (i.e. birth), but they are two signs amongst the Signs of Allah. So, if you see them (i.e. eclipse) offer the (eclipse) prayer.
عَنِ النَّبِيِّ ﷺ قَالَ إِنَّ الشَّمْسَ وَالْقَمَرَ لاَ يَخْسِفَانِ لِمَوْتِ أَحَدٍ وَلاَ لِحَيَاتِهِ وَلَكِنَّهُمَا آيَتَانِ مِنْ آيَاتِ اللَّهِ فَإِذَا رَأَيْتُمُوهُمَا فَصَلُّوا