Commandment/Law Keeping – Self-Righteousness – Legalism – the Rich Young Ruler – the Gospel…a Christian perspective…
Jesus, born of the virgin seed to circumvent the sin-nature passed through Adam (Romans 5:21), fulfilled the moral mandates upon which the Sinai Commandments are based as Jesus is the Living Word and Messiah is also the fulfillment of all that the ceremonial-civil laws foreshadowed (John 1; Colossians 2:16). It is through His perfection that Messiah became the ONLY acceptable blood atonement for your sin (Acts 4:12; John 3; John 14:6; Matthew 26:28).
The moral law under girding the Law Covenant will never pass away (Matthew 24:35) as it has been relevant as an arbiter of free will from the creation of the angels forward (Romans 2:14-15). This same moral law judged Satan and under girded his extrication from the Kingdom (Luke 10:18) which initiated the creation of our Universe, Time, physics, as a repository (Genesis 1); this same moral law judged the Adamic and Noahic generations where all perished in water save eight; this same moral law is the foundation for the Sinai Commandments as Elohim codified, in stone, specific aspects of the moral law concerning Israel’s affiliation with paganism that inundated the Tribes and as a bulwark against same.
The Sinai Commandments given specifically to the Hebrew Tribes and converts to Judaism are NOTHING NEW or novel…just a reiteration of the moral law with specificity, that moral law having been written in the heart of every human being created in the likeness of Elohim as a communicable attribute (Genesis 1:26-28).
Concerning the Rich Young Ruler and Commandment keeping (Matthew 19:16-22),
The rich young ruler approached Jesus and asked him what He MUST DO to inherit eternal life suggesting that he was sufficiently righteous in and of himself to earn God’s forgiveness. Jesus had previously provided the young man a path to eternal life by asking why he called Jesus “good” as no one is “good” but God; in this, Jesus asked the young man if he recognized Jesus as God which would have been the KEY to eternal life (John 8:24) but the young man did not recognize Jesus; therefore, Jesus said…if you want to earn eternal life, “keep the Commandments” The young man, in his self-righteousness” stated that he had kept the Commandments at which time Jesus proceeded to demonstrate to him that he had NOT kept the Commandments by telling the young man if he wanted to be perfect (righteous), go and give his possessions away and come and “Follow ME!”
Again, Jesus provided the young man a path to Eternal Life through belief-faith in Jesus as Messiah but the young man walked away sad because he loved his wealth more than God; in this, Jesus demonstrated that the young man had violated the Greatest Commandment to love God above all else and the one likened to it, “Love your neighbor as yourself.”
Jesus knows we cannot keep the Commandments sufficiently to earn our own righteousness (Romans 3:20) as the Law mandates absolute perfection (James 2:10) and we’re sinners under the condemnation of sin (Romans 3:23); therefore, the Law curses anyone who seeks righteousness through it (Galatians 3:10).
The Father, in His unfathomable mercy, sent His Son, Jesus Christ, as a sacrifice for sin (John 3:16; 1 John 4:10) and through faith in Jesus as Lord mankind can receive the imputation of Jesus’ perfection/righteousness IMPUTED into the life of the one who believes by faith that Jesus is Lord and that He died to pay our sin-debt and through faith, the one receiving Jesus as their Lord is declared “not guilty” by the Father via covenant promise…this is the Gospel of Jesus Christ (2 Corinthians 5:21; John 3; Hebrews 8:12).