Castling Into Check
You cannot castle into check. This means that you cannot castle if the King will end up on a square that is attacked. It is an illegal move, as the King is in check after the move! Note that you also are disallowed from Castling Out of Check, or Castling Through Check by the rules of chess.
Related Chess Rules Topics
Read more about these related chess rules, chess puzzles, and other chess tactics and strategies: