Sayyiduna Ali (may Allah be pleased with him) says that I used to visit the Prophet (peace and blessings be upon him) daily. If I wanted to enter the house of the Prophet (peace and blessings be upon him) and he was praying, he would cough, and when he was silent, I would not enter the house. Once, I visited at night, so the Prophet (peace and blessings be upon him) came out and said, "A strange incident happened tonight. I felt someone's movement in the house, so I became anxious and came out, and there was Jibreel (peace be upon him) standing in front of me. I asked him, 'Why did you not come inside the house?' He said, 'A dog has entered your room from somewhere, so I cannot come inside.' And indeed, under Hasan's chair, there was a puppy. And he said, 'The angels do not enter a house in which there is a dog, a person in a state of major impurity, or a picture.'"
Hadith Referenceمسند احمد / مسند الخلفاء الراشدين / 845