Hi DEE,
I'm not sure if there's a standard Excel tag, but the Office Development tag is for developing Office Add-ins. I think for questions like this, you'd get a quicker answer from places like r/excel or Stack Overflow.
As for your specific question, I think the problem is that your rules need to be in the opposite order. I did a quick repro in the screenshots below that shows in one order, the yellow formatting always applies and in the other the red formatting is correctly applied. There's also a "stop if true" option you should probably check for your closer due date condition.
Hope this helps!