If your king has been in check on a previous move, but didn't move to avoid it, you can still castle on a later move.
If your king is currently in check, or any of the squares in his path are under attack, he may not castle:
Incidentally, having a1 or b1 under attack is NOT an impediment to castling -- only the king's squares matter. Famously, Victor Korchnoi asked an arbiter about that rule during one of his world championship matches with Karpov!
I m a beginer....
no where i m getting exact rules...of castling
in this wesite it give tht the king shouldnt pass through check.. for castling
but while playing it actually allows us 2 castle if our king has passed a check and if we have avoived it ,and the king hadnt moved.....
i m damn confused......
plz help
thx in advance