Good question, but unfortunately it is not one that begets a simple answer, as much as we would like one. The short answer is that it varies from case to case, and some large part of it depends on who is doing the investigation into the aftermath. In the largest part (and this is a simplified explanation, so no arguing it out of relevancy please) it is based upon when a third party decides that the aggressor presents a threat to your (the defenders) life and safety, or to the life and safety of those the defender is acting for.
In this story the DA chose not to prosecute, but a different one could have chosen to throw the book at the shooter, and, based on the information in the news report, won. Premeditated murder is one possible charge
Milanovic and his father told police a week before the shooting they would shoot any intruders who returned
At the same time a ?jury of their peers? chose to find that lethal force was, in this instance, uncalled for. With the dead ?victim? shot through a shed door, and the second one in flight, neither one could be found to have been presenting a threat under Colorado law. So, by law, the jury finding was correct, even if it is a morally ambiguous one