You may have seen my recent thread, my wife and i had to say goodbye to our dog a few days ago for this reason.
It was the hardest decision i've ever made. I don't think i can draw clear lines as far as what exactly would lead to the decision. I think you just know.
When you've trained, and the dog listens to you and does everything you've trained him to do, and he's otherwise healthy, but he still will unpredictably attack someone without warning or provocation, that's a bad sign. My dog did that twice, as well as countless other smaller episodes that where i managed to prevent it. My house was already basically on lockdown already, but there was a slip up and i ended up in the ER for 6-7 hours sitting with a friend.
It's so hard. I still feel like we made the right decision, though it's haunting me a bit.