It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) did not enter the Ka'bah during the Hajj, but he entered it in the year of the Conquest of Makkah. When he came down, he prayed four rak'ahs, or he said: two rak'ahs, between the Black Stone and the door, facing the Ka'bah, and he said: "This is the qiblah."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11758