For in it the righteousness of God is revealed from faith for faith, as it is written, “The righteous shall live by faith.”
Romans 1:17 ESV
God's justice is different than man's and relies primarily upon our faith in him. If you trust God, he counts you as one of his and will save you. This is the righteousness of God.
"The righteous shall live by faith" is a quote from Habakkuk 2:4 in which "righteous" is more literally translated as "just" and could be thought of as "justified". Belief in the promises of God brings life and we walk out that belief by living according to his commandments. Even if we don't understand how God's laws or actions are righteous, our faith requires that we accept that they are.