Gen 2:17 reference is for the second death not the first.
The fact that we are still dying in spite of Jesus dying for us, shows that death is more than what we know it to be in everyday meaning. There is something called "second death" in the Bible.
Rev.20:6 “Blessed and holy is the one who takes part in the first resurrection. The second death has no power over them, but they will be priests of God and of Christ, and they will reign with him for a thousand years.”
It worth noting how clearly this second death is mentioned at Rev. 2:11; 20:6, 14; 21:8. One of the first things God told Adam was regarding the forbidden fruit. He said:
Gen.2:17, “but you must not eat from the tree of the knowledge of good and evil, for when you eat from it you will surely die.”
The same day they were supposed to have been paying the penalty for their disobedience; the penalty was death. But they didn't die the same day, because:
John 3:16 For this is the way God loved the world: He gave his one and only Son, so that everyone who believes in him will not perish but have eternal life.
A substitute was already planned and therefore the penalty of sin was differed. When Adam died at the age of 930 years he was not paying the penalty of sin. Adam's probationary period of overcoming sin was over at nine hundred and thirty years; his lifespan ended.
In fact the Bible uses another word “sleep” many a time, when talking about the death that comes at the end of a lifetime. Talking about Lazarus' death, Jesus himself called it sleep. He said:
John 11:11-14 After he said this, he added, “Our friend Lazarus has fallen asleep. But I am going there to awaken him.” Then the disciples replied, “Lord, if he has fallen asleep, he will recover.” (Now Jesus had been talking about his death, but they thought he had been talking about real sleep.) Then Jesus told them plainly, “Lazarus has died,
This word "sleep" has been used several times, in reference to the first death or the natural death that all have to face in this sinful world. (See Job 14:10-12, 1 Thessalonians 4:15, 16). All the people who ever died on planet earth died only the natural death or the first death; and first death is the consequence (natural result) of sin-because of Adam's fall-and not the wages (punishment) of sin.
The death of Christ and also His resurrection were divine acts, and not natural acts. Death had no power on Him, as He did not sin. For us to die is natural, for Christ it was not. He was doing something that otherwise would not have happened. Just before Jesus could go to Calvary, this is what He said about Satan:
John 14:30 I will not speak with you much longer, for the ruler of this world is coming. He has no power over me.
Satan had no power over Christ, as Christ did not yield to temptation. He had to lay His life down as a voluntary act for our salvation, and He did it. He was paying the penalty of the human race on the cruel Cross. He was dying the death that we deserved. Paul wrote: ...so that by God’s grace he would experience death on behalf of everyone. (Hebrew 2:9)
First death and second death:
The death that Christ died was the second death. The first death is a natural consequence of sin. Whether one is a believer or unbeliever, the first death is for all, whether a saint or a sinner. It is the close of probationary time, either to make it or break it to Heaven. When Adam and Eve were told that they would die the day they ate the fruit, it was a reference to the second death (the eternal extinction), not the first death.
The first death physically destroys the body, but it is not an eternal destruction, as there will be a resurrection. But the second death is the eternal destruction of the person. So the second death is the real death, the complete death. The first death has only a part of the second death in it. The second death has the first death and more in it.
(Rev 20:6, 14, 15; 21:8), and not "first and second death", as the second death is the complete death.
Those who die the second death have no resurrection. But Jesus rose from the dead even though He died the second death. Well, because He was sinless, He was dying a substitution death. He was not dying for His sin (He did no sin), but for the sins of the others (the whole world).
When we die the first death, we can afford to smile and die, and even sing while burning at the stake, because we know it is only the first death, and there is a resurrection. But when Jesus was dying the death on Calvary, He cried in bitter agony:
My God, my God, why hast thou forsaken me? (Matthew 27:46)
But when we die our natural death, we don't cry that way, as God does not forsake us. It is at the final death, the second death, when people pay the wages of sin, they would feel the bitter agony of being forever cut off from God and from life, and then all will cry and weep and gnash their teeth.
When Christ bore the sins of the world on Him, He could not, for that moment, see beyond the portals of the tomb, as it was total darkness within Him and around Him too. Only by faith He knew that resurrection was possible for Him while He was bearing our sins upon Himself. And that's how He gave hope to the thief, and that's how He committed His breath into the hands of His Heavenly Father and died. And lo! And behold! On the third day our Lord conquered the grave as He conquered death! Listen to the Victor:
Rev. 1:18 I am he that liveth, and was dead; and, behold, I am alive for evermore, Amen; and have the keys of hell and of death.
#Apologies for this long answer.