If you are under the law, then that rule applies to you.
But if you are led by the Spirit, you are not under the law. Galatians 5:18
If you are led by the Spirit, rather than the desires of the flesh, then you are going to practice righteousness.
It is those who "practice righteousness" that are righteous.
Little children, let no one deceive you. He who practices righteousness is righteous, just as He is righteous. 1 John 3:7
When we are led by the Spirit, we are led to do what is good, not evil, and what is right in the eyes of the Lord.
- those who have done good, to the resurrection of life
28 Do not marvel at this; for the hour is coming in which all who are in the graves will hear His voice 29 and come forth—those who have done good, to the resurrection of life, and those who have done evil, to the resurrection of condemnation. John 5:28-29
JLB