For one will scarcely die for a righteous person—though perhaps for a good person one would dare even to die— 8 but God shows his love for us in that while we were still sinners, Christ died for us. -Romans 5:7–8 (ESV)
To illustrate the extent of God’s love, Paul appeals to the unexpected and shows how “the cross is the means by which God demonstrates his love.”
A righteous man in this case is in reference to other men, not toward God necessarily. He uses the word righteous to describe what men would say of someone who did what was required of him in a societal setting (i.e., took care of his family, paid his bills on time, was lawful, and was a man who overall acted in accordance with one who was a good neighbor).
A good man here is used to surpass a merely righteous man in the worldly sense. The good man is one who excels in his righteous behavior, one whom the community admires as above the status quo. He is not only lawful and kind but perhaps generous, maybe even heroic in some sense.
One would hardly find a person die for a righteous person, and perhaps you might find someone who would willingly lay down their life for one they admired and perhaps aspired to be like.
But God’s love is greater. He died for sinners, the lawless ones whom no one would think to give their own precious lives for. That’s you and me, says Paul.
Christ died for us—sinners, ones deserving of death.