Castling In Standard Chess
The king moves two squares toward the rook he intends to castle with (this may be either rook). The rook then moves to the square through which the king passed. If the king castles queen-side the rook must move four squares. However on the king-side the rook only moves three squares.
The castling move has some fairly rigid restrictions:
1. It can only occur if there are no pieces standing between the king and the rook.
2. Neither king nor the rook to be castled with may have moved from its original position. (The other rook may have already moved.
3. There can be no opposing piece that could possibly capture the king in his original square, the square he moves through or the square that he ends the turn.
Castling In Chess 960
the basic requirements before 960 castling are:
1.neither your king nor castling rook have moved
2.there are no pieces between your king and castling rook
3. your king does not pass through check on the way to its final square
4.your king is not currently in check
5.there is space for your king and castling rook to land in their final castled positions - for kingside castle: that is F1 (rook) and G1 (king) for white and F8 (rook) and G8 (king) for black, and for queenside castle: that is C1 (king) and D1 (rook) for white and C8 (king) and D8 (rook) for black.
For More Detail check here:- http://en.wikipedia.org/wiki/Chess960