The shape has to be two separate shapes, but they can be on one layer. I would create guide lines for where you want the lines of the retangles to be. They draw one rectangle with the pen tool. Select the combine shapes mode for the pen tool, then draw the second rectangle, starting on a corner not touching the other rectangle. If you edit this shape, it will still be two rectangles, and the anchor point that connects the top left anchor point of the bottom rectangle will not edit the top rectangle, if you move it.
I'm wondering if there would be any advantage in combining them into a Smart Object. You'd still be working with two layers when editing, but would have one for storing. I do that for things like client sponsor logos that I can keep in named CC Libraries.