I was asked about (al-Masjid al-Aqsa) what was it before the Muslims, and what was it when (Rasoulillah Sallallahu Alaihi wa Sallam) did his (Isra' and Meraj) from there? Did (Rasoolillah) two Rak'ah near the rock before the (Isra')?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Al-Masjid Al-Aqsa (the Aqsa Mosque) was the Muslim's first Qiblah (direction which they face in their prayers) and the third mosque of the three ones to which traveling is lawful.
It is the first House set on earth for the worship of Allah, The Almighty after the Sacred House (Al-Masjid Al-Haraam) of the honored Makkah. It was built after the Sacred House by forty years. This can be deduced from Saheeh Muslim where he cited a Hadeeth reported by Abu Tharr and traced to the Prophet .
The first to build the both aforementioned mosques was Adam and his family, or, as some say, the Angels. What those who came after did was just refurbishing, making maintenance, or re-establishing their foundations.
Al-Masjid Al-Aqsa passed under various successive states and generations. By the advent of Islam, it was under the ruling of the Byzantines until peacefully taken over by the Muslims in the 16th year of Hegira, during the reign of ‘Umar Ibn Al-Khattb .
As for the prayer the Prophet performed at the Night of Ascension, it was inside the blessed Masjid Al-Aqsa, and not near the Rock which was outside the Mosque.
At that Night (of the Blessed Ascension), the Prophet tied Al-Buraaq (his beast) to that Rock. This is the only significance and excellence this Rock has in Islam.
For more benefit on Al-Aqsa Mosque, please refer to Fataawa 85459 and 83441.
Allah knows best.
You can search for fatwa through many choices