The Prophet ﷺ would not enter the home of any woman except his wives, with the exception of Umm Sulaym, whom he used to visit. When he was asked about this, he said, "I feel compassion for her. Her brother was killed fighting alongside me."
كان النبي ﷺ لا يدخل على أحد من النساء إلا على أزواجه إلا أم سليم، فإنه كان يدخل عليها، فقيل له في ذلك، فقال: إني أرحمها قتل أخوها معي.
Bukhari narrated it in the Book of Jihad (2844), and Muslim in the Book of the Virtues of the Companions (2455), both of them through Hammam, from Ishaq bin Abdullah, from Anas, who said what has already been mentioned. His statement, "except Umm Salim," reflects his own knowledge ﷺ but it is otherwise established in sahih hadith that he used to visit other women as well, such as Umm Haram bint Milhan, as recorded in Sahihayn.