@oolongteasup,
4 of the 6 squares can be selected in C(6,4)=15 ways.
Once the squares are chosen, they can be populated in
4! / (w! * x! * y! * z!) ways
where w, x, y, and z are the number of occurrences of the first, second, third, and fourth letter, and w+x+y+z=4
Obviously, if at least one letter is duplicated, there can't be four different letters - at least one of w, x, y, and z must be zero. But that's OK because 0!=1.
The answer you seek is the product of the two calculations. Assuming the four letters are unique, the answer is 15*24=360.
The general formula is easier to state when the letters are unique:
N = the number of squares
M = the number of (unique) letters
The number of ways is
C(N,M) * M! = N! / [(N-M)! * M!] * M! = N! / (N-M)!