We can permute 8 pieces in 8! =40320 ways.
But we have some conditions:
Two knights are identical.
There must be opposite colour bishops.
Rooks are identical.
King must be between the rooks.
Now in 8 boxes there are 4 black boxes and 4 white boxes.
We can place the black bishop in one of the 4 black boxes which can be done in 4 ways. Similarly the position ...