What 2 Conditions Need to Be Satisfied in Chess Before You Can Castle?
There are a number of conditions that need to be satisfied before you can castle.
You cannot castle if the king has already moved, or if the rook in question has moved.
Nor can you castle while in check. However, you can castle with a rook that is under attack at the time, and the rook can pass through an attacked square when castling while the king cannot. (Amusingly, this was once called into question at the highest level, when a top Grandmaster, Viktor Korchnoi, went to confirm with the arbiter that he could castle with his rook under attack during a game with Karpov in 1974.)
What Are the Origins of Castling?
As with other special moves like the double-step for pawns and en passant, the origins of castling date to the late medieval period, when the modern rules of chess were being finalized. Also like those other innovations, one of the main drivers of the change was to speed up the game. Developing material is one of the major themes of the opening section of a chess game, and castling allows you to quickly get a rook toward the center of the board, which can considerably hasten their development. This is why castling figures prominently in a number of famous chess openings.
But there’s another reason for the development of this special move: it gives you a way to quickly get the king to safety. This need came about because of some other developments around the same time, namely, the development of the modern queen and bishop.
During this period, it was considered safer to keep the king near the center of the board. Once the diagonal lanes became vectors of attack however, the king became vulnerable to attacks from the flanks as well as the center.
Castling gave players a quick way to get their king to the edges of the board, protecting it from early assaults.
When Is It A Good Idea to Castle?
Castling can be a very powerful move because it’s essentially two moves at once. It can be a great way to get your king to safety while developing a powerful attacking piece in your rook. That said, knowing when to castle is critical. Here are a few tactical considerations to keep in mind:
Where is your king most useful? In many situations (possibly even the majority of them), it’s better to have your king safely in the corner, where they’re less vulnerable to diagonal attacks. That makes an early castle a potentially appealing move. That said, there may be situations where a number of bishops or even queens exit the game early. In these endgame-like situations, it may be better to have the king near the center, where it may reveal itself to be a powerful attacking piece.
Can you get your rooks chatting? Rooks that are connected (also called “communicating” or “chatting”) have an open rank between them. This frees them to patrol the rank, supporting other pieces freely while protecting one another.
Can you disrupt your opponent’s attack? Sometimes it’s best to wait until your opponent has committed to an attack before you castle. Timed right, this can defuse your opponent’s attack while setting your own pieces up for a counterattack. Remember, while you can’t castle out of or through check, your rook can castle out of or through an attacked square.
Quote from: https://www.masterclass.com/articles/chess-101-what-is-castling-learn-about-the-2-conditions-that-need-to-be-satisfied-in-chess-before-you-can-castle#what-2-conditions-need-to-be-satisfied-in-chess-before-you-can-castle