The rest of that story goes like this, diverting from how you were applyig that verse of what Jesus was saying that for.
Matthew 19:17 And he said unto him, Why callest thou me good? there is none good but one, that is, God: but if thou wilt enter into life, keep the commandments. 18 He saith unto him, Which? Jesus said, Thou shalt do no murder, Thou shalt not commit adultery, Thou shalt not steal, Thou shalt not bear false witness, 19 Honour thy father and thy mother: and, Thou shalt love thy neighbour as thyself. 20 The young man saith unto him, All these things have I kept from my youth up: what lack I yet? 21 Jesus said unto him, If thou wilt be perfect, go and sell that thou hast, and give to the poor, and thou shalt have treasure in heaven: and come and follow me. 22 But when the young man heard that saying, he went away sorrowful: for he had great possessions. 23 Then said Jesus unto his disciples, Verily I say unto you, That a rich man shall hardly enter into the kingdom of heaven. 24 And again I say unto you, It is easier for a camel to go through the eye of a needle, than for a rich man to enter into the kingdom of God. 25 When his disciples heard it, they were exceedingly amazed, saying, Who then can be saved? 26 But Jesus beheld them, and said unto them, With men this is impossible; but with God all things are possible.
Okay then. It is not possible for men to enter into life by keeping the commandments. If men could so such a thing, then Christ died in vain.
Galatians 2:20 I am crucified with Christ: nevertheless I live; yet not I, but Christ liveth in me: and the life which I now live in the flesh I live by the faith of the Son of God, who loved me, and gave himself for me. 21 I do not frustrate the grace of God: for if righteousness come by the law, then Christ is dead in vain.
Galatians 3:21 Is the law then against the promises of God? God forbid: for if there had been a law given which could have given life, verily righteousness should have been by the law. 22 But the scripture hath concluded all under sin, that the promise by faith of Jesus Christ might be given to them that believe.
Galatians 3:10 For as many as are of the works of the law are under the curse: for it is written, Cursed is every one that continueth not in all things which are written in the book of the law to do them. 11 But that no man is justified by the law in the sight of God, it is evident: for, The just shall live by faith. 12 And the law is not of faith: but, The man that doeth them shall live in them. 13 Christ hath redeemed us from the curse of the law, being made a curse for us: for it is written, Cursed is every one that hangeth on a tree: 14 That the blessing of Abraham might come on the Gentiles through Jesus Christ; that we might receive the promise of the Spirit through faith....26 For ye are all the children of God by faith in Christ Jesus. 27 For as many of you as have been baptized into Christ have put on Christ. 28 There is neither Jew nor Greek, there is neither bond nor free, there is neither male nor female: for ye are all one in Christ Jesus. 29 And if ye be Christ's, then are ye Abraham's seed, and heirs according to the promise.