Abraham believed God and there was evaluated to him unto righteousness.
This statement is repeated five times in the Greek scriptures. (I include LXX as one of the times.) 'Accounted' says the KJV and others but the verb is deponent and has no subject and no direct object and relates to the word logion whose meaning Paul demonstrates in regard to coinage.
Saul of Tarsus was 'blameless' according to the law, that is to say none could blame Saul for his outward conduct. But, within, Paul confesses he was slaughtered by the commandment 'thou shalt not covet'. Within, worked the law and within, he discovered that 'in my flesh there dwelleth no good thing'.
But he was not far from the kingdom of heaven. For Paul believed in the Lord Jesus Christ and Paul, as a result of being justified (by God himself, in view of that faith) received the Holy Spirit whose influence - within - sanctified him.
And as a result Paul says he kept his body under lest he, himself, despite preaching to others, should be a castaway.
The influence of the Holy Spirit within him, caused Paul to deny the sin which is in the flesh and to (as Peter enjoins) 'abstain from fleshly lusts which war against the soul'.
This is to be saved indeed. Not only that men should see no outward blameworthy conduct but that, within, there should be 'holiness unto the Lord'.
But had Paul, in later life, fallen into (and never been recovered from) sin, that is to say sin which can be witnessed by others, then he, himself, admits that he would be a castaway.
It would be proved that he had never, rightly, believed in God at all. It would be outwardly demonstrated, by his falling into evil and never coming out of it, that his faith was counterfeit, it was just intellectual, it did not come from the heart, it was not of an 'Abraham kind' of faith which emanated from the depths of the inner man. It was just words on paper, words repeated, doctrines memorised.
He would be as one in the parable of Jesus, caught up in the widespread net of the gospel and gathered into the boat, but, when examined, found to be 'bad' not 'good' and not fit to be a vessel (in the figure, put in a vessel) and worthy only to be cast back into the sea.
Such a one never had any righteousness. They had not truly believed and therefore there was not that faith within them which, God seeing, he can see within it his own (God's) righteousness and therefore he can 'account' or evaluate it to the believer, unto righteousness.
For it is 'God that justifieth' (who is he that condemneth ?) not a man that justifies himself. God sees his own rightness within a man's faith and God accounts of it (values it) and God justifies that man for within him is (God's) righteousness.
And such a man will be granted the gift of the Holy Spirit and such a man will be one of the sons of God who are led of the Spirit and are chastened (and scourged) of the Father. And such shall never be lost. Such shall never fall away.
Such, shall endure to the end and such shall be saved.
Whom he called, that is to say whom the Father called, them he also justified. And whom he justified, them he also glorified.
But many are called (by an outwardly preached gospel, gone forth into all the world) that are not chosen. They may be caught up in the net, and gathered into the boat.
But the storms will come and the floods will attack and they, being not founded in rock, shall be swept away.
But he that endureth to the end, continuing in good works as led of the Spirit and purged of the Father, shall be saved.
For their righteousness (saith the Lord) is of me.
For the one who justifies is Jehovah Tsidkenu - the Lord, our righteousness.