It has been well said that if there is anything good in any man it is because it was put there by God. And something good — a new, sinless nature — has been imparted by God to every believer. Every believer is instantaneously "regenerated" by the Holy Spirit (Titus 3:5) when "the Spirit of life in Christ Jesus" (Rom. 8:2) came into the spirit of every person who believes to receive Him with His nature.
While there is still within us “that which is begotten of the flesh,” that Paul calls "Sin in the flesh" (Romans 8:3b), there is also “that which is begotten of God" by His Spirit,” and just as the one is totally depraved and “cannot please God,” so the other is absolutely perfect and always pleases Him.
Adam was originally created in the image and likeness of God, but he fell into sin and later “begat a son in his own likeness, after his [own] image” (Gen. 5:3). It could not be otherwise. Fallen Adam could generate and beget only fallen, sinful offspring, whom even the Law could not change. But “what the law could not do, in that it was weak through the flesh, God, sending His own Son in the likeness of sinful flesh, and for sin,” accomplished, “that the righteousness of the law might be fulfilled IN us, who walk NOT after the flesh, but after the Spirit” (Rom. 8:3,4),
As Adam was made in the likeness of God, but fell, so Christ was made in the likeness of sinful flesh, to redeem us from the fall, that by grace, through the operation of the Spirit, a new creation might be brought into being, a “new man… renewed in knowledge after the image of Him that created him” (Col. 3:10) a “new man, which, after God is created in righteousness and true holiness” (Eph. 4:24). Referring to this “new man,” John says:
“Whosoever is born [begotten or regenerated] of God doth not commit sin, for his [God's the Father's "seed" - Jesus Christ) remaineth in him: and he cannot sin, because he is born [begotten] of God” (I John 3:9)
“We know that whosoever is born [begotten] of God sinneth not…” (I John 5:18).
Though we may at times fail at righteous living, we as believers are "counted" as Righteous "in Christ." You see, on the cross a great exchange took place. Our sin, the sin of believers, was transferred to Jesus, and he was cursed. And Jesus’ righteousness was transferred to us so that we might be counted righteous.
"For he [The Father] hath made him to be sin for us, who knew [Gk. ginosko, had no experience of sinning] no sin; [so] that we might be made the righteousness of God "in him." (2 Corinthians 5:21)
Jesus lived a perfect life. Jesus "was tempted in every way like as we are" but he never sinned (Heb. 4:15). He always obeyed his Father in Heaven. He never even desired to disobey. All of his perfect obedience was transferred to us when we believed on Jesus. God the Father looks at us as if we are righteous the moment we believe, and he gives us the blessing of the Holy Spirit to enable us to live righteous lives here and now.