No, Jesus’ response in Matthew 19:17 shows that the man cannot gain eternal life by doing good, because he has not kept—and indeed cannot keep—the commandments through which one can obtain life if one could keep them (Leviticus 18:5; Ezekiel 20:11; Romans 10:5; Galatians 3:12). The righteousness in the Jewish sense that the man has in mind (see Matthew 19:17) can never attain eternal life (Galatians 2:16, Galatians 3:10–11). He needs another to gain it for him, and he does not see that only Jesus can do this, so Jesus confronts him with the full requirement of the divine law: Keep the commandments. Jesus is not speaking of meriting salvation, but only of what he has done and will do, and what we, by his power, are enabled to do.
No, the man whom Jesus responds to here in Matthew 19:17 does not realize that he cannot attain eternal life by doing good. He needs another to acquire it for him, and he does not see that Jesus can and will do this. Jesus therefore confronts him with the full requirement of the divine law: Keep the commandments. If he wishes to do it himself, then let him keep the commandments; it is stated in the simplest possible terms.
The man must be brought to the realization that he cannot do so himself, because he has not kept—and indeed cannot keep—the commandments through which one truly can obtain life if one were to be able to keep them (Leviticus 18:5; Ezekiel 20:11; Romans 10:5; Galatians 3:12). The reality is that the righteousness in the Jewish sense that the man has in mind (see Matthew 19:17) will never lead to the attainment of eternal life (Galatians 2:16; Galatians 3:10–11).1
Jesus is not here referring to meriting salvation, but only to what Christ has done and what we, by his power, are enabled to do. The young man had to realize that he was not able to fulfil Jesus’ requirement.2
17 Il lui répondit: Pourquoi m'interroges-tu sur ce qui est bon? Un seul est le bon. Si tu veux entrer dans la vie, observe les commandements. Lesquels? lui dit-il.