How many (3x3) square arrangements? 
In how many ways can we place 9 identical squares - 3 red, 3 white and 3 blue, in a 3x3 square in a way that each row and each column has squares of each three colours?

Let the colors be $RGB$, let the white=green for simplicity, then the top row has the following cases:
$RGB, RBG, BRG, BGR, GRB, GBR = 6$ cases.
Take the $RGB$ configuration first: we have:
$$R G B $$
Below $R$ there are two possibilities, $G, B$, suppose you choose $G$ so now we have:
$R G B$
$G$ ==> Now there are two choices there: $R, B$ then one choice for the last one, and for the whole row beneath, one choice each.
If you chose $B$ then you would have had:
$R G B$
$B$ ==> Only one choice left $(R)$ and then one again for last, and the one choice for each of the spots in the last row.
In total, there are $2 + 1 = 3$ possible arrangements here, it would have been the same for the other cases ($GBR, RBG$, etc...).
The final answer should be $6(3) = 18$, but the actual answer is $9$? 

There are $3!=6$ ways to put the squares in the first row, 
and then 2 ways to complete the first column.
This completely determines the square, so there are $6(2)=12$ possibilities
