I can point you to an article that appeared in the Wisconsin Lutheran Quarterly that succinctly addressed your question. The article is worth a read. Below are some thoughts from the conclusion of the article:
“On the basis of a well-meant desire to affirm the authenticity of Christ’s temptations some Christians have asserted that it was theoretically possible for Christ to have sinned. When the question is raised how it would have been possible for Christ to have sinned if he was truly God, the answer is usually that Jesus could have sinned only in his human nature, not in his divine nature. To claim that Jesus or his human nature could have sinned without God sinning requires that Jesus’ humanity had an existence separate from God. Jesus, then, is not truly God. He is just a man inhabited or possessed by God in a special way, much like a person possessed by the devil. When we limit Christ’s actions to one of his natures rather than his person, we destroy the unity of his person and end up with a Nestorian Christ, one whose two natures are just glued together like boards and which can be pulled apart. If we accept this principle, then it follows that his death was simply the death of his human nature, not the death of God’s Son, that is, the death of God. Jesus certainly could not have been tempted if he had no human nature, just as he could not die without a human nature. But both of these were acts of the person, just as all his acts for our salvation were.
“For Jesus to sin would have meant either that God sinned or that the personal union was broken. Biblical Christology allows neither of these possibilities.”
Jesus was “tempted in every way, just as we are—yet was without sin” (Hebrews 4:15). Jesus was perfect in our place. He did what we cannot do: he rejected temptation. Because we fail to reject temptation and avoid sin, Jesus suffered the punishment we deserved.
Jesus lived up to his name, which means “Savior,” by living a holy life in our place and suffering the punishment our sins deserved. Jesus’ active obedience and passive obedience were both necessary for our salvation.
This link will take you to the article I cited.