In most of the United States, that is no longer true. The law previously required a "duty to retreat" if the home owner encountered a potentially violent assailant. However, most states now have "Castle Doctrine" laws which shift the burden of proof from the defense to the prosecutor. [0]
Most prosecutors will not charge a home owner due to this change in laws. Civil liability is separate factor, but criminal charges are rare.
[0] https://en.wikipedia.org/wiki/Castle_doctrine