The prayer of "signs" (ayaat) is obligatory when any of the following signs occur:-
1. Solar eclipse.
2. Lunar eclipse.
4. Any natural occurrence which normally creates fear in the common people, like black, red or yellow storm, cyclone and things like that.
In solar and lunar eclipses, the time of the "prayer of signs" is from beginning of the eclipse till it is completely cleared.
In other causes like earthquake it must be prayed soon after the cause subsides. But it is always ada even if prayed many days after its occurrence.
Prayer of signs is 2 rak’ats; every rak’at has 5 ruku’ (total 10 ruku’).
After niyyah and Takbiratul-ihram, you should recite Surah al-Hamd, then any other Surah; then go to ruku’. Your one ruku’ is complete. After rising from ruku’, recite again Surah al-Hamd and one Surah and go to ruku’. Your second ruku’ is complete. Likewise, you should do 5 ruku’. After rising from 5th ruku’, say 'Sami’ Allahu liman hamidah' and go to sajdah. Complete 2 sajdahs as usual and rise for the 2nd rak’at.
Likewise, do 5 ruku’ in the 2nd rak’at, and perform 2 sajdahs, recite tashahhud and salaam as usual. Your prayer is complete.
Note: It is mustahab to recite qunut before every second ruku’. For this purpose count all ten ruku’ together, Thus you will recite qunut before the 2nd and 4th (in the first rak’at), and before the 6th, the 8th and the 10th ruku’ (in the 2nd rak’at).
Also you are allowed to pray this prayer by a short method:
After Takbiratul-Ihram, you recite Surah al-Hamd, and only a part of a Surah; then go to the first ruku’, after rising recite another subsequent part of that Surah and go to the second ruku’, rise again and recite the third subsequent part of that Surah and go to the 3rd ruku’. Likewise do before the 4th and the 5th ruku’, finishing the Surah before 5th ruku’.
For example: Surah al-Ikhlas is 5 verses. You may recite 'Bismillahir-Rahmanir-Rahim' before first ruku’; 'Qul-Huwa’llahu Ahad' before the 2nd ruku’; Allahus-Samad' before the 3rd ruku’; 'Lam yalid wa lam yulad' before the 4th ruku’; and 'Wa lam yakun lahu kufuwan ahad' before the the 5th ruku’,
Thus you would have read only one al-Hamd and only one complete Surah in one rak’at. You may recite one rak’at in one way and the other rak’at in the other way.