Sayyiduna Ali (may Allah be pleased with him) says that I used to present myself before the Prophet (peace and blessings be upon him) twice every morning and evening. If I wanted to enter the house of the Prophet (peace and blessings be upon him) and he was praying, I would cough. Once, I came at night, so the Prophet (peace and blessings be upon him) said: "Do you know what happened tonight? I was praying when I sensed some movement in the house. I became anxious and went outside, and there was Jibreel (peace be upon him) standing. He said: 'My whole night has passed waiting for you. A dog has entered your room from somewhere, so I could not come inside, because we do not enter a house in which there is a dog, a person in a state of major impurity, or any picture or statue.'"
Hadith Referenceمسند احمد / مسند الخلفاء الراشدين / 608