You often say this sentence to someone when you strongly relate with their problems because you more likely had this problem before or you still have it
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).