Голос шахмат
You can't castle into check, out of check, and your king can't move through a square attacked by an opponent's piece (can't castle through check). You also can't castle if the king or the rook you are castling with has previously moved
Previously being checked doesn't stop castling, as long as the other rules are observed.
If you need help, please contact our Help and Support team.