I am looking for some references that generalize the question "how many different ways we have to order $n$ items in a row" to a multi-dimensional setting.

Something like: Assume that there are $n$ (2-dimensional) squares of the same length. What is the number of different (2-dimensional) patterns that can be made using those $n$ squares?

Thanks!