Hmm, I really don't know the answer to that question, it's something I struggle with as well.
Maybe you could give him a time limit to complain? In a nice way not a teasing way. Maybe something like 'I know you have a lot of hurt to express, but it's painful for me to hear it and maybe it's not very productive, can we set a timer for 5 minutes and then move forward onto another subject? You're allowed to have your feelings but perhaps we could be more present and future oriented'

My dh has gone on a couple of rants about how miserable he was blah blah blah. I've stopped being defensive, and I've started validating as much as I can, but it still hurts. And maybe me validating just leaves dh stuck too, he's entitled to his feelings but I have worked super super hard to forgive him and let go of resentments to think about the future.

Or maybe if he won't agree to a time limit then both of you take a 30 minute time out to calm down and then go back to your conversation more civilly?