All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
The answer for this question is mentioned in a Prophetic narration. Abu Razeen Al-'Uqayli narrated that he asked the Prophet : "Where was Allaah before He created the heavens and the Earth? He who does not speak from his own inclination, but a Revelation revealed to him, replied: "He, the Exalted, was in a could, [i.e. in darkness, and in Arabic it could also mean that this is a matter which Allaah did not reveal to his Creation] above which is air, and beneath which is air, and then He created the Throne and rose over it." [At-Tirmithi, Ibn Maaja, Al-Bayhaqi, and Ath-Thahabi classified it as a sound narration]
Allaah Knows best.