That is not what He said. I see this common instinct to justify oneself by reinterpreting what He said to fit one's personal religious practice, preferences, doctrines, etc. rather than simply believing what He said like a little child and obeying.
Luk 24:44-49 And he said unto them, These are the words which I spake unto you, while I was yet with you, that all things must be fulfilled, which were written in the law of Moses, and in the prophets, and in the psalms, concerning me. (45) Then opened he their understanding, that they might understand the scriptures, (46) And said unto them, Thus it is written, and thus it behoved Christ to suffer, and to rise from the dead the third day: (47) And that repentance and remission of sins should be preached in his name among all nations, beginning at Jerusalem. (48) And ye are witnesses of these things. (49) And, behold, I send the promise of my Father upon you: but tarry ye in the city of Jerusalem, until ye be endued with power from on high.
The Holy Spirit inspired Scripture says this:
2 Corinthians 5:17-21 Therefore, if anyone is in Christ, he is a new creation. The old has passed away; behold, the new has come. All this is from God, who through Christ reconciled us to himself and gave us the ministry of reconciliation; that is, in Christ God was reconciling the world to himself, not counting their trespasses against them, and entrusting to us the message of reconciliation. Therefore, we are ambassadors for Christ, God making his appeal through us. We implore you on behalf of Christ, be reconciled to God. For our sake he made him to be sin who knew no sin, so that in him we might become the righteousness of God.
Romans 4:1-8 What then shall we say was gained by Abraham, our forefather according to the flesh? For if Abraham was justified by works, he has something to boast about, but not before God. For what does the Scripture say? Abraham believed God, and it was counted to him as righteousness. Now to the one who works, his wages are not counted as a gift but as his due. And to the one who does not work but believes in him who justifies the ungodly, his faith is counted as righteousness, just as David also speaks of the blessing of the one to whom God counts righteousness apart from works: Blessed are those whose lawless deeds are forgiven, and whose sins are covered; blessed is the man against whom the Lord will not count his sin.
Romans 4:20-25 No unbelief made him waver concerning the promise of God, but he grew strong in his faith as he gave glory to God, fully convinced that God was able to do what he had promised. That is why his faith was counted to him as righteousness. But the words it was counted to him were not written for his sake alone, but for ours also. It will be counted to us who believe in him who raised from the dead Jesus our Lord, who was delivered up for our trespasses and raised for our justification.
The only righteousness that can get us into heaven is perfection and we can't do that. Not to mention that our righteous deeds are as filthy rags in God's sight because they are tainted with sin, so they CAN'T count.
The only way to be considered righteous enough for heaven is to be forgiven and have the righteousness given to us, credited to our account.
Colossians 3:1-4 If then you have been raised with Christ, seek the things that are above, where Christ is, seated at the right hand of God. Set your minds on things that are above, not on things that are on earth. For you have died, and your life is hidden with Christ in God. When Christ who is your life appears, then you also will appear with him in glory.
When God sees us, He sees us hidden in Christ, through a filter, so to speak, that He sees us as righteous as Christ.