I will leave my family when I have to save my country.
>> I will leave my family if I have to save my country.
If the country is safe, my family, or the place where my family is living- won't be dangerous.
>> If the country is safe, my family, or the place where my family is living- won't be in danger.
In ancient Korea, there was a story which was about a general who killed his family because he was sure that his country will collapse after the war and his family will be slaves. I will not kill my family with my hand, unless the opposite-sided country doesn't do any bad things.
>> I will not kill my family with my own hand, unless the opponent country will do anything bad.
I mean I will consider the war very seriously and leave my family for the glory of triumph.