Sayyiduna Abdullah bin Busr (may Allah be pleased with him), the Companion of the Messenger of Allah (peace and blessings be upon him), said: "When the Messenger of Allah (peace and blessings be upon him) came to someone's door to seek permission, he would not stand directly facing the door. He says: (Rather) he would keep along the wall until he sought permission; then either permission would be given to him or he (peace and blessings be upon him) would go back."
Related hadith on this topic