Not all homicides are murder.
You are right.
If someone is killed by a perp during the commission of a crime, legally that is murder.
If someone breaks in my house and I kill them, that is justifiable homicide, not murder.