The rabbis had added so many commands to those in the Mosaic Law that the young man did not know which commandments Jesus meant. Jesus listed the sixth, seventh, eighth, ninth, and fifth commandments, in that order, plus part of "the greatest commandment" ( Leviticus 19:18). All of these commandments deal with observable behavior. [source][source][source]
"Jesus did not introduce the Law to show the young man how to be saved, but to show him that he needed to be saved [1]." [2][source]
The fact that the young man claimed to have kept all of them reveals the superficiality of his understanding of God"s demands (cf. Matthew 5:20; Philippians 3:6). Moreover, having lived an upright life he still had no assurance that he possessed eternal life. This is always the case when a person seeks to earn eternal life by his or her goodness. One can never be sure he or she has done enough. This young man may have been rich materially, but he was lacking what was more important, namely, the assurance of his salvation. [source][source][source]