Every man was judged and found guilty when Adam disobeyed God’s commandment. It didn’t matter that it was Adam alone that disobeyed God.
Unfortunately all mankind were in Adam when he disobeyed God. In Adam, we all sinned against God; as such we all participated in his punishment, we all inherited death from Adam.
Fortunately for man, Jesus Christ came to die on his behalf. Although Jesus is God, the Bible says that He did not consider Himself to be equal with God. He assumed the position of a Son; came to this world in order to be crucified for the sins of mankind.
Jesus became man in order to die for man. As a man, He was obedient to the Father in all things, even unto the shameful and painful death of the cross. He did this because of the love He has for man.
He bored the sins of the whole world upon His flesh so as to crucify sin in the flesh.
The transaction that took place at Calvary was the exchange of the sinful nature of the world. At Calvary cross, the sins of the whole world were imputed to the flesh of Jesus; and Jesus nailed it to the cross.
His obedient to death was for the salvation of the souls of mankind from everlasting damnation. His death on the cross was the crucifixion of the sins of the whole world.
Although we did not die together with Jesus on the cross but He bore our sins in His body and nailed it to the cross. In other words, our sins were crucified when Jesus was crucified.
So in the same way we were in Adam when he disobeyed God and inherited death from Adam; so also are we in Christ when He died on the cross and inherited the forgiveness of sins and the gift of righteousness.