A young man wanted to know what he had to do to inherit eternal life, and Jesus told him to keep the commandments, naming five in the process. The young man said to Jesus, “And he said, ‘All these things I have kept from my youth'” (Luke 18:21).
That was good, although he still lacked something that Jesus revealed to him later. The young man evidently had a good upbringing, and he stayed with it, at least to a point.
Perhaps later he repented of the one thing that was holding him back, because while keeping the commandments of God is good, we have to make sure that we are everything He wants us to be.