<s>[INST] Place the counters on a $4\times 4$ grid such that no column or row has the same color counters 
There is a $4\times 4$ grid posted on the wall. Find the number of ways of placing two identical red counters and two identical blue counters on four different squares of the grid such that no column or row has two counters of the same color.

My solution: place the first blue counter $B_1$: there are 16 ways. Next, place $B_2$: there are 9 ways.
After, I split into cases:
-The first case: $R_1$ is placed not coinciding with the cross of $B_1$ or $B_2$.
-The second case: $R_1$ coincides with exactly one cross of $B_1$ or $B_2$.
-The third case: $R_1$ coincides with the crosses of $B_1$ and $B_2$.
I find my solution is quite long and complicated. Therefore, I want to refer to another solution. Please everyone help me.
 [/INST] Your approach is fine!
As regards the blue counters we have $16$ ways for $B_1$ and $9$ for $B_2$. Now we may assume that $B_1$ is on square $(1,1)$ and $B_2$ on square $(2,2)$ and we have  3 cases for the red counters:
1) if $R_1$ is on $(2,1)$ or on $(1,2)$, then $9$ places are left for $R_2$.
2) if $R_1$ is on  $(3,1), (3,2),(4,1), (4,2),(1,3), (2,3),(1,4), (2,4)$, then $8$ places are left for $R_2$.
3) if $R_1$ is on $(3,3), (3,4),(4,3), (4,4)$, then $7$ places are left for $R_2$.
Hence the number of ways is equal to
$$\frac{16\cdot 9}{2}\cdot \frac{2\cdot 9+8\cdot 8+4\cdot 7}{2}=3960.$$
By using the same strategy, we find the number of ways for a grid $n\times n$:
$$\frac{n^2\cdot(n-1)^2}{2}\cdot \frac{2\cdot(n-1)^2+4(n-2)\cdot((n-1)^2-1)+(n-2)^2\cdot((n-1)^2-2)}{2}$$
which reduces to
$$\frac{n^2\cdot(n-1)^2\cdot(n^4-2n^3-3n^2+8n-2)}{4}.$$
For $n\geq 1$ the numbers are $0, 2, 198, 3960, 33800, 180450, 715302, 2306528$.
</s>