The second line is unusual for Proverbs and is worth reading carefully.
Quick answer
Two men at the end. One is driven out by what he did; the other has somewhere to go.
Read both lines
The first line follows the book's normal pattern, with wickedness doing the banishing rather than a sentence being passed. The second line is the surprising half, because Proverbs rarely looks past death at all, and here the righteous is said to have a refuge in his death. The book does not develop the thought and this catalog will not develop it for them. What the verse establishes is that the righteous man is not without shelter at the point where the wicked man has run out of road, and it stops there.
Why translations differ
The phrase is compressed, and versions handle it differently: some read a refuge in his death, others take the sense as the righteous having hope even in death, and some ancient traditions read the line quite differently. This is a case for the third certainty register. The expression is genuinely debated, and it cannot responsibly be made to carry a developed doctrine of the afterlife on its own, in either direction. What it plainly says is that at the end the two men are not in the same position.
Related: Proverbs 11:7 · Proverbs 12:28 · Proverbs 18:10
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.