2 “If a thief is caught breaking in at night and is struck a fatal blow, the defender is not guilty of bloodshed;

Read Exodus 22:2 Using Other Translations

If a thief be found breaking up, and be smitten that he die, there shall no blood be shed for him.
If a thief is found breaking in and is struck so that he dies, there shall be no bloodguilt for him,
“If a thief is caught in the act of breaking into a house and is struck and killed in the process, the person who killed the thief is not guilty of murder.