Those were just five of the ten commandments. What about the other five? Was God his one and only God, or was it his wealth? "I am the Lord your God, you shall have no other gods before Me. (Exodus 20:2-3).
Was he idolizing or worshipping his wealth or any of his material possessions more than God? You shall not make for yourself a carved image - any likeness of anything...you shall not bow down to them nor serve them. For I the Lord your God am a jealous God (Exodus 20:4-5).
Had he used the Lord's name in vain? You shall not take the name of the Lord your God in vain, for the Lord will not hold him guiltless who takes His name in vain (Exodus 20:7).
Was his wealth so important to him that he neglected going to the synagogue (church) and worked instead, or he never went at all? Remember the Sabbath day, to keep it holy (Exodus 20:8).
Did he ever covet, long for something that belonged to someone else with envy? You shall not covet your neighbor's house; you shall not covet your neighbor's wife, nor his male servant, nor his female servant, nor his ox, nor his donkey, nor anything that is your neighbor's (Exodus 20:17).Was he obedient to these commandments as well?
When this wealthy young man said that he had been obedient to those commandments since his youth, Jesus then challenged him to see how obedient he was willing to be to truly learn what it took to inherit eternal life.
"Then Jesus, looking at him, loved him, and said to him, “One thing you lack: Go your way, sell whatever you have and give to the poor, and you will have treasure in heaven; and come, take up the cross, and follow Me.” But he was sad at this word, and went away sorrowful, for he had great possessions." (vvs 21-22, emphasis mine).
Jesus clearly illustrates to us that if other things are more important to us than God, then we do not deserve to go to Heaven. We must repent of our sins and become born again as He said (Mark 1:15, Luke 13:5, John 3:3-5).
The apostles preached this too, "Repent therefore and be converted, that your sins may be blotted out, so that times of refreshing may come from the presence of the Lord," (Acts 3:19).
I recently received this cartoon illustration that depicts a few people taking up their cross to follow Christ (Matthew 16:24). The simplicity of the cartoon makes it obvious that a person needs Christ, to become born again, in order to inherit eternal life.