God is the one who justifies the ungodly. "Him that justifies the ungodly" is a
participial phrase describing God. It does not mean that God justifies before faith, it just means that God is the one that justifies the ungodly.
Read carefully.
So Him the justifies the ungodly is a participle that is used as an adjective, that is it is describing or asserting something about God, namely that God justifies the ungodly.
Justify-Greek dikaioo- to render, show, declare, or pronounce one to be righteous.
To justify. Strong's Greek: 1344. δικαιόω (dikaioó) -- to show to be righteous, declare righteous (biblehub.com) δικαιόω dikaióō, dik-ah-yo'-o; from
G1342; to render (i.e. show or regard as) just or innocent:—free, justify(-ier), be righteous. (
G1344 - dikaioō - Strong's Greek Lexicon (kjv) (blueletterbible.org) )
So the one who believes on God, who justifies the ungodly, his faith is counted for righteousness, ie God justifies Him. DECLARED RIGHTEOUS (counted for righteousness) AND JUSTIFIED IS THE SAME THING. Faith is counted for righteousness is synonomous with justified
through faith. (Notice I said THROUGH, not BY. )