Allah ordained prayer through the tongue of your Prophet as four units while resident, two units while traveling, and one unit during fear.
فرض الله الصلاة على لسان نبيكم في و الحضر أربعا وفي السفر ركعتين، وفي الخوف ركعة.
Muslim narrated it in the Book of the Prayer of Travelers (687) through several routes from Mujahid and others, from Ibn Abbas, and from Musa bin Salama Hudhali, who said, I asked Ibn Abbas, "How should I pray when I am in Makkah, if I do not pray with the imam?" He said, "Two rakat, the sunnah of Abu Qasim ﷺ."The view of Ibn Abbas was adopted by Nafi, Jubayr bin Mutim, and Hasan in one report, as well as Ibn Jurayj. It is the position chosen by Ibrahim Harbi, and Ibn Abdul-Barr favored it, as Ibn Rajab mentions in his Fath al-Bari (2/126).Accepting the view of these scholars implies that Ayesha's statement was mistaken. Some scholars have held that her statement is a mawquf report, and a mawquf report carries no weight against a marfu one. Ibn Abbas's statement, "Allah made prayer obligatory through the tongue of your Prophet," indicates that his report is marfu.However, Ayesha's statement should likewise be judged as marfu, since this is not a matter open to personal reasoning. If this is established, then reconciliation between the two is possible. One could say that Ayesha is speaking about the obligation of prayer being set on the night of the Night Journey in Makkah, while Ibn Abbas is speaking about the obligation of prayer being set in Madinah, as is mentioned in Ayesha's hadith recorded by Bukhari (3935), "Then the Prophet ﷺ migrated, and prayer was made obligatory as four rakat."As for his statement, "and during fear, one rakat," this should be understood as meaning that a person prays one rakat with the imam, then completes another rakat on his own, as is found in the sahih hadiths. The majority of scholars held that the prayer of fear is the same as the ordinary prayer in the number of rakat, so if it takes place while residing, four rakat are required, and if it takes place while traveling, two rakat are required.