You often say this sentence to someone when you strongly relate with their problems because you more likely had this problem before or you stillhave it
Maria: I'm diagnosed with Depression and Anxiety
Julie: That hit close to home
Don't shit too close to home by, for example, bringing strangers into your house and then fighting with them inside your house (since they know where you live).