Suppose you have an $m \times n$ rectangle, and piece types $t_1, \ldots t_N$, and quantities $q_1 \ldots q_N$ of each piece.
If $N=1$, then the answer is simply $\binom{mn}{q_1}$, and by "conditioning on where types $t_1, \ldots t_{N-1}$ went" we get the general answer is $$\prod_{i=1}^N \binom{ nm - \sum_{j < i} q_j}{q_i}$$
More directly (and independent of the choice of ordering!), this can be seen as $$\frac{(mn)(mn-1) \ldots (mn - {\sum_i q_i}+1)}{\prod_i q_i!}$$where we divide out by the product of the factorials to account for the fact that pieces of the same type are indistinguishable.