Rules & Basics
Castling in Chess: The Rules, and When You Can't Do It
Learn exactly how castling works in chess, the 5 conditions that must be met, and when the rules prevent you from doing it.

Castling is the only move in chess where you move two pieces at once, and it trips up beginners more than almost any other rule. The short version: your king slides two squares toward a rook, then that rook jumps over and lands on the square the king just crossed. Simple enough, except there are five conditions that all have to be true at the same time, and missing any one of them makes the move illegal.
Once you know how the chess pieces move, castling is the next rule worth understanding properly, because it's part of virtually every well-played game.
What Castling Looks Like on the Board
Start with the standard starting position. If you've read about how to set up a chess board the right way, you know the king starts on e1 (for White) and the rooks sit on a1 and h1.
Kingside castling (O-O): The king moves from e1 to g1. The rook on h1 then lands on f1. After the move, your king is on g1, tucked behind pawns on f2, g2, and h2, with the rook on f1 beside him.
Queenside castling (O-O-O): The king moves from e1 to c1. The rook on a1 jumps to d1. Three squares of open file are needed on the queenside (b1, c1, d1), compared to just two on the kingside (f1, g1), which is part of why queenside castling is a little less common in beginner games.
For Black, the same logic applies mirrored: kingside castling puts the king on g8 with the rook on f8; queenside puts the king on c8 with the rook on d8.
In notation, castling kingside is always written O-O and queenside is O-O-O (the letter O, not zero).
The Five Conditions for Legal Castling
All five must be true. If even one fails, the move is off the table for that moment (though some conditions can become true again later, while others are permanent).
| Condition | Kingside | Queenside |
|---|---|---|
| Neither the king nor that rook has moved | Yes | Yes |
| No pieces stand between king and rook | f1 and g1 must be empty | b1, c1, and d1 must be empty |
| The king is not currently in check | Yes | Yes |
| The king does not pass through check | f1 must not be attacked | c1 must not be attacked |
| The king does not land in check | g1 must not be attacked | c1 must not be attacked |
A few notes on this table worth spelling out:
The king cannot castle out of check. If your king is in check right now, you have to deal with the check some other way, whether by moving the king, blocking, or capturing the attacker. You cannot use castling as your escape route.
The king cannot pass through check. On the kingside, the king travels through f1 to reach g1. If an enemy piece controls f1, castling kingside is illegal even if g1 itself is safe. On the queenside, the king passes through d1 and c1. If either of those squares is under attack, the move is off.
The king cannot land in check. This one almost goes without saying, since landing in check is never legal, but it catches beginners who forget to check whether the destination square is covered.
Note on queenside castling: the b1 square (which the rook crosses but the king never touches) does NOT need to be safe from attack. The rook can pass through an attacked square; only the king's path matters.
The "Has Moved" Rule: It's Permanent
If your king has ever moved, castling is gone for the rest of the game, full stop. Same with the rook: if your h1 rook has moved, you can still castle queenside (the a1 rook is unaffected), but kingside castling with that specific rook is gone.
This means if you moved your king off e1 to avoid a threat, then moved it back to e1, you still cannot castle. The rule tracks whether a move was ever made, not where the piece currently sits.
This is why strong players are careful not to waste a king move in the opening. Even one unnecessary king move costs you the right to castle on that side permanently.
Why Castling Matters: King Safety and Rook Activation
Castling does two useful things at once. After you castle kingside, your king is tucked into the corner behind a wall of pawns, which is much harder to attack than a king sitting in the middle of the board. Meanwhile, the rook that was sleeping on h1 now sits on f1, an active central file where it can participate in the game.
In the opening, both sides typically try to castle within the first ten or so moves. The sequence 1.e4 e5 2.Nf3 Nc6 3.Bc4 followed by developing the remaining bishop and castling is a common pattern in the Italian Game and related systems. You clear the pieces off the back rank, then castle, then connect your rooks.
If you leave your king in the center too long, you risk your opponent opening lines in the middle of the board and creating direct threats before your king has a safe home.
Common Beginner Mistakes with Castling
Moving the king or rook by accident early on. If you shift your rook to avoid a pin and then move it back, you've permanently lost the right to castle on that side. Think twice before moving either piece in the first few moves.
Forgetting that check prevents castling right now. New players sometimes try to castle as a response to a check. You cannot, but the right to castle (if conditions are otherwise met) isn't permanently lost just because you were in check. Once the check is resolved and the other conditions still apply, you can castle on a future turn.
Leaving a piece on f1 or g1 and forgetting why you can't castle. The squares between king and rook must be completely empty. Even one piece, regardless of whose, blocks the move. This one bites players who develop their bishops but forget to get the knight out.
Castling into a battery on an open file. Castling puts you king in the corner, but if your opponent already has a rook and queen lined up on the g-file, moving your king to g1 can be dangerous. Castling is usually good for king safety, but look at the position first.
Kingside vs Queenside: Which to Choose?
For most beginners, kingside castling is the default. It requires clearing only two squares (f1 and g1, typically your bishop and knight), and it tucks the king into a corner that is relatively easy to protect.
Queenside castling needs three clear squares and often takes a move or two longer to set up. However, it can be the better choice if your queenside is well developed and you want to bring your queen's rook into play quickly. When both sides castle on opposite sides, you often get sharp attacking games where each player races to attack the other's king. When both castle on the same side, the game tends to be more positional.
You can learn more about how this fits into the broader game in our guide to the complete rules of chess for absolute beginners.
FAQ
Can I castle if my rook is under attack?
Yes. The rook being attacked by an enemy piece does not prevent castling. Only the king's path and landing square matter. As long as none of the conditions above are violated, you can castle even if the rook you're castling with is under attack.
Can I castle after my king was in check, once the check is dealt with?
Yes, as long as the king never actually moved to get out of check. If you blocked the check with another piece or captured the attacker, the king stayed on e1 and the right to castle is preserved. If you moved the king to escape, castling is gone permanently.
Does castling count as a king move or a rook move?
It counts as a king move. That's why in notation we record where the king goes, not the rook. If a rule or condition refers to "the king moving," castling counts.
What happens if there's a piece on b1 during queenside castling?
You cannot castle queenside. All three squares between the king and the a1 rook (b1, c1, and d1) must be empty. Move or develop that piece first, then castle.
Is castling always the right move?
No. Castling is usually a good idea in the opening and middlegame, but there are positions where it's actively bad, particularly if the squares around where your king will land are already under attack, or if keeping the king in the center helps you control a specific file or diagonal. In the endgame, the king often does better in the center of the board anyway, so late castling is rarely meaningful. Evaluate the position; don't castle on autopilot.