How to Pray the Eclipse Prayer
Question

How is the eclipse prayer offered?
Praise be to Allah.Hadiths about eclipse prayer 

Al-Bukhari (1041) and Muslim (911) narrated that Abu Mas`ud Al-Ansari (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “The sun and the moon are two of the signs of Allah by means of which Allah creates fear in His slaves. They do not become eclipsed for the death of any person. If you see anything happen to them, then pray and call upon Allah until you are relieved of that.”
Al-Bukhari (1059) and Muslim (912) narrated that Abu Musa (may Allah be pleased with him) said: The sun was eclipsed , and the Prophet (blessings and peace of Allah be upon him) got up in a state of anxiety, thinking that it was the Hour. He came to the mosque and began to pray, standing, bowing and prostrating for the longest time I ever saw him do, and he (blessings and peace of Allah be upon him) said: “These signs that are sent do not occur for the death or birth of anyone, rather Allah sends them to create fear in His slaves. If you see any of them, then hasten to remember Him, call upon Him and ask Him for forgiveness.”

How to pray the eclipse prayer
The way in which the eclipse prayer is performed is as follows:

The worshipper recites the opening Takbir (Takbirat Al-Ihram) and the opening supplication (Du`a Al-Istiftah), then he seeks refuge with Allah (from the devil).
Then he recites Al-Fatihah, followed by a lengthy recitation.
Then he bows, making it lengthy.
Then he rises from bowing and says: Sami‘a Allahu liman hamidah, Rabbana wa laka Al-hamd (Allah hears those who call upon him; our Lord, praise be to You).
Then he recites Al-Fatihah again, followed by another lengthy recitation but shorter than the first recitation.
Then he bows again, making it lengthy but shorter than the first time.
Then he rises from bowing and says: Sami‘a Allahu liman hamidah, Rabbana wa laka Al-hamd, and stands for a long time.
Then he prostrates twice, making each prostration lengthy, and sits for a long time between the two prostrations.
Then he gets up for the second Rak`ah, and does the same as he did in the first Rak`ah, bowing twice and so on, but each action is not as long as in the first. Then he recites the Tashahhud and the Taslim.(See Al-Mughni by Ibn Qudamah (3/323); Al-Majmu` by An-Nawawi, 5/48) 

This is indicated by the Hadith of `Aishah. Al-Bukhari (1046) and Muslim (2129) narrated that `Aishah (may Allah be pleased with her), the wife of the Prophet (blessings and peace of Allah be upon him) said: 
“The sun was eclipsed during the lifetime of the Messenger of Allah (blessings and peace of Allah be upon him). The Messenger of Allah (blessings and peace of Allah be upon him) went out to the mosque and stood and said Takbir, and the people formed rows behind him. The Messenger of Allah (blessings and peace of Allah be upon him) recited for a long time, then he said Takbir and bowed for a long time. Then he said, ‘Sami‘a Allahu liman hamidah.’
Then he stood and did not prostrate, and (again) recited for a long time, but it was shorter than the first time.
Then he said Takbir and bowed for a long time, but it was shorter than the first time.
Then he said, ‘Sami‘a Allahu liman hamidah, Rabbana wa laka Al-hamd.’
Then he prostrated. Then he did likewise in the second Rak`ah.
Thus he did four bowings and four prostrations.”
For more details, please see the following answers: 65719 , 6309 , 6124 , 5901 , and 121250
And Allah knows best.