$\begingroup$

Suppose we create a layout by deleting borders between the panels of a $3\times 3$ grid, as has been suggested at various times. But let's put some restrictions on which borders we can delete so that no non-rectangular panels are possible, but all layouts with rectangular panels are possible.

Consider the four border segments that meet at a single vertex in the $3\times 3$ grid. Label these segments $N, E, S, W$ in clockwise order starting from the top. If you delete three of these segments and leave one intact, you end up with a panel with a "crack" in it, not a rectangle. There are $4$ forbidden arrangements of this kind. If you delete two "adjacent" segments such as $N, E,$ you end up with a panel that has a "concave" corner, again not a rectangle. That gives us another $4$ forbidden arrangements.

But any of the other $16 - 4 - 4 = 8$ combinations of border segments around a common vertex can occur in a layout consisting purely of rectangles. Call these the permitted combinations.

It seems "obvious" (though maybe not so obvious how to prove) that as long as all four vertices in the interior of the grid have permitted combinations of edges, the layout will consist only of rectangles.

Actually counting the combinations that can occur together is more complicated. It's not $8^4,$ because there are many ways the choice of combination of edges at a vertex can be restricted by the combinations at the adjacent vertices.

To enumerate the possibilities, consider the edges that might or might not exist around the central square of the $3\times 3$ grid.

Case 1. All four edges exist. So the $NE$ vertex of this square has at least $W$ and $S$ edges; there are $3$ permitted combinations of the the other two edges. Similarly, there area $3$ permitted combinations at each of the other three vertices of the central square. This gives us $3^4=81$ possible layouts.

Case 2. Three edges exist. To begin with, we have $4$ choices of which edge to delete. Then, at each of the two vertices adjacent to the deleted edge, there are exactly $2$ permitted combinations of edges. (For example, if we delete the $E$ edge of the central square but not its other three edges, the $NE$ vertex has edge $W$ but not edge $S$; it must therefore have edge $E$ but edge $N$ is optional.) At each of the other two vertices, there are still $3$ permitted combinations. Altogether, there are $4 \times 2^2 \times 3^2 = 144$ layouts of this kind.

Case 3. Two opposite edges exist, the other two are deleted. There are $2$ ways to choose which pair of edges to delete around the central square; at each of the four vertices there are then $2$ permitted combinations of edges. Altogether there are $2\times 2^4 = 32$ layouts of this kind.

Case 4. Two adjacent edges exist, the other two are deleted. There are $4$ ways to choose which pair of edges to delete around the central square. At the vertex with two edges there are then $3$ permitted combinations of edges; at each of the two vertices adjacent to that, there are $2$ permitted combinations of edges; and at the fourth vertex (the one with two adjacent deleted edges already) all four edges must be deleted. Altogether there are $4\times 3 \times 2^2 = 48$ layouts of this kind.

Case 5. One edge exists. We have $4$ choices of which edge this will be. Then, at each of the two vertices adjacent to the remaining edge, there are exactly $2$ permitted combinations of edges. The other two vertices already have two adjacent edges deleted, so they each must have all four edges deleted. Altogether, there are $4 \times 2^2 = 16$ layouts of this kind.

Case 6. No edges exist around the central square. There is only one layout with this property, the one consisting of a single panel.

Adding it up, we have $$ 81 + 144 + 32 + 48 + 16 + 1 = 322,$$ so there are $322$ possible layouts.