Use 3 shapes:
These have only the right layering order. The darker shapes are identical, but the upper is brought to front and the lower is sent to back.
You must define edge color if the fill colors must be equal.
The case needs more if the fill colors must be transparent and no visible overlap is allowed. The overlaps can be removed with boolean subtract. Here's another attempt with it:
The cyan parts are transparent, the yellow shape in the background is there only to show it.
It has still 3 parts. A copy of the horizontal part is subtracted from the lower vertical part and a copy of the upper vertical part is subtracted from the horizontal part. As exploded the parts after subtractions are these:
Just in this case no subtraction is a must, the parts can be also deformed with point edits or they can be drawn from scratch to their right forms. With grid snap that should be no problem.
BTW your first image would look more right than this if it had strong enough diagonal in the overlap rectangle. Two transparent parts layered should be less transparent and it happens in your 1st image.