This is a very hard question to answer as we have either breaking the laws of God in lying on one end, and on the other a innocent life to defend. Normally we would just jump in by saying we would lie to save a life and that lying would be OK because God knows the situation, and he will understand. We are sure never to be quick to answer as this leads us into more trouble at times, and in the multitude of words there is sin. How can someone say "Yes I would lie to save a life" when they have never been in that situation before. There are just to many variables that would be happening behind the scene that would not be known to that person. For example, If I said to a group of Christians "I for sure would lie to save a life" and then I find my self in that situation and there comes evil men to seek out hidden Jews hiding in my house. They produce my children in front of me and say, "we are going to kill your children right now in front of you unless you tell us were these people are" Do you think that would have a impact on what my decision would be? I would tell them to save my children, and then I would be found out to be a liar, and did not do what I said. No one knows what happening behind the scenes in these kinds of situations except God. This is why we are told this.......
James 4:13 Come now, you who say, "Today or tomorrow we will go into such and such a town and spend a year there and trade and make a profit"--
James 4:14 yet you do not know what tomorrow will bring. What is your life? For you are a mist that appears for a little time and then vanishes.
James 4:15 Instead you ought to say, "If the Lord wills, we will live and do this or that."
James 4:16 As it is, you boast in your arrogance. All such boasting is evil.
Saying you would do or say something in the future is not something we would know in advance because we do not know what tomorrow would bring. James calls this "boasting" and it is evil.
Here is a example of people doing just that.
Mark 14:26 And when they had sung a hymn, they went out to the Mount of Olives.
Mark 14:27 And Jesus said to them, "You will all fall away, for it is written, 'I will strike the shepherd, and the sheep will be scattered.'
Mark 14:28 But after I am raised up, I will go before you to Galilee."
Mark 14:29 Peter said to him, "Even though they all fall away, I will not."
Mark 14:30 And Jesus said to him, "Truly, I tell you, this very night, before the rooster crows twice, you will deny me three times."
Mark 14:31 But he said emphatically, "If I must die with you, I will not deny you." And they all said the same.
Not only did Peter say he would ever fall away, and he was willing to die with Jesus that night, but all of the Apostles said the same thing.
Yet that exact same day they fell away!!!! They opened there mouth and said something without knowing all what was going on. As the scriptures tell us, boasting is a thing of pride, and pride all ways comes before a fall.
Mat 26:33 Peter answered him, "Though they all fall away because of you, I will never fall away."
Mat 26:34 Jesus said to him, "Truly, I tell you, this very night, before the rooster crows, you will deny me three times."
Mat 26:35 Peter said to him, "Even if I must die with you, I will not deny you!" And all the disciples said the same.
Now this is how we should conduct our lives in these kinds of situations.
Luk 21:12But before all this they will lay their hands on you and persecute you, delivering you up to the synagogues and prisons, and you will be brought before kings and governors for my name's sake.
Luk 21:13This will be your opportunity to bear witness.
Luk 21:14 Settle it therefore in your minds not to meditate beforehand how to answer,
Luk 21:15 for I will give you a mouth and wisdom, which none of your adversaries will be able to withstand or contradict.
Act 4:5 On the next day their rulers and elders and scribes gathered together in Jerusalem,
Act 4:6 with Annas the high priest and Caiaphas and John and Alexander, and all who were of the high-priestly family.
Act 4:7 And when they had set them in the midst, they inquired, "By what power or by what name did you do this?"
Act 4:8 Then Peter, filled with the Holy Spirit, said to them, "Rulers of the people and elders,
(Notice Peter did not know what to say here, it was the Holy Spirit speaking through him in his discourse)
Act 4:9 if we are being examined today concerning a good deed done to a crippled man, by what means this man has been healed,
Act 4:10 let it be known to all of you and to all the people of Israel that by the name of Jesus Christ of Nazareth, whom you crucified, whom God raised from the dead--by him this man is standing before you well.
Act 4:11 This Jesus is the stone that was rejected by you, the builders, which has become the cornerstone.
Act 4:12 And there is salvation in no one else, for there is no other name under heaven given among men by which we must be saved."
Act 4:13 Now when they saw the boldness of Peter and John, and perceived that they were uneducated, common men, they were astonished. And they recognized that they had been with Jesus.
Act 4:14 But seeing the man who was healed standing beside them, they had nothing to say in opposition.