Sorting rendering of two quads

The question either doesn’t make sense or is trivial.

Either you mean that the two are completely parallel to one another… in which case the answer is pretty trivial. Or you mean that they are potentially not parallel to one another in which case the answer is impossible (as they may interpenetrate).

Take a step back and tell us what you are actually trying to do.

It helps avoid these sorts of problems: