When did Adam die Genesis 2 v17 or Genesis 5 v5?
Genesis 5:5 speaks of Adam's physical death, after he and Eve ate of the forbidden tree (Genesis 3:7).
Revelation 20:6 refers to a "second death" to those who don't take part in the "first resurrection." Looking at the surrounding context, the idea is that a person without Christ will suffer two deaths: a physical one and a spiritual one. In one sense, Adam died spiritually when he sinned and his eyes were "opened" (Genesis 3:7), and so did all of mankind.
Other passages imply that "death" in this context doesn't mean the cessation of biological function, but rather separation from God. Thus "on that day" that Adam sinned, he separated himself from God ... he died spiritually.
The Bible does speak of physical death but not as a result of sin. It is in the creational order that God has ordained biological life and it's natural end.
The whole issue in Genesis is communion with God. The Resurrection restores this communion.
When one enters in a new relationship with God he has entered the life of Resurrection.
He is no longer separated but reunited in Christ.
2:17 - he'll die spiritually
5:5 - he dies physically