Which side should I castle if I have opportunity to castle on both sides? It's a little bit confusing for me to make good decisions when I have opportunity to castle on both sides.

Can somebody explain what are the factors should be considered if we have opportunity to castle on both sides?
can somebody explain what are the factors should be considered if we have opportunity to castle on both sides?


1. The most important factor is king safety;

Long castle is less safe than short one, because king is closer to the center, thus can be attacked faster. You will lose a tempo to properly secure the king with Kb1/Kb8 ( thus protecting the loose a-pawn as well ). In many openings c-file is open/semi open which heightens the danger for the king.

Short castling moves the king far away and there are no loose pawns to protect. Furthermore, opponent must invest considerable amount of time to organize the attack by moving his forces to the kingside. This means that he must abandon some squares/pawn protection which enables you to organize strong counterplay.

2. King's activity in an endgame;

Long castle is preferred as your king will be close to the center. This fact can constitute a big advantage in endgame as king now becomes very powerful.

3. How fast do you need to develop pieces/launch an attack?

You need 2 moves to castle short ( you must move f1 bishop and g1 knight and you are done ), while you need 3 for long castle ( you need to move the queen, c1 bishop and b1 knight ). In opening speed is very important, therefore super GMs prefer short castle.

On the other hand, when castling long, rook lands immediately to d1 which is the best square for him, while with short castle you need to spend extra tempo to centralize rook with Re1.

When choosing where to castle, you should also ask yourself where do you lead the attack. If you play in the center and you plan a fast attack, prefer long castle. If you do not know what will you do at the moment than short castle is more flexible.

PRACTICAL GUIDELINES FOR APPLYING THE ABOVE:

First you need to form a general plan based on the factors listed above and personal preferences:


Will you attack or play positionally?
Are you willing to play the endgame or you are going for mate?
On which side of the board are you stronger, regarding your piece placement?
How well are you placed to attack on kingside/queenside?
Is your pawn structure healthy, on the side where you want to castle?
What is the state of center of the board -> is it closed/open/semi-open?


If you have opportunity to castle both sides than first look at your pawn structure. Is it healthy ( pawns are at starting positions ) or you have doubled pawns/pawn islands/"holes"? You should prefer the side that has healthy pawn structure. 

Once you answer this question ask yourself the following: How well are my pieces placed to defend my king from opposing forces? If you have enough defenders, then go for that side.

This was the easy case, you have healthy pawn structure and solid defense on one side of the board, but what if you are good on both sides? What if your pawn structure and piece placement is good on both wings?

Then you must take endgame into consideration! If you can force a lot of exchanges go for the long castle ( even better if opponent went short castle! ). If the game will last long, and will be sharp or simply there are no signs for lots of exchanges, then you need to take attacking potential into consideration. Maybe you could go for "opposite side castling" because you will get promising pawn storm, or you could go for quiet game by castling to the same side as the opponent since you plan to attack in the center? This is really position-dependent part.

PRACTICAL EXAMPLES THAT ILLUSTRATE THE ABOVE:

Let us take a look at the following position and apply the above principles:

[Title "Where to castle?"]
[fen "r1bqr1k1/pp1nbppp/2p2n2/3p2B1/3P4/2NBPN2/PPQ2PPP/R3K2R w KQ - 0 1"]


First factor, king safety: we see that White is safer on kingside, and if he castles there he has good prospects for minority attack on the queenside, and for "f4 push" on the kingside ( please see my answer to this question for detailed coverage of these plans if you need further explanations ). The later option is beneficial for positional players.

Second factor, the activity of the king in the endgame, is bad for White since his king is further from the center then it would be after long castle. But if he wishes to play for minority attack he need both rooks on quenside, and in those positions the endgame will not appear for a long time.

Third factor, speed, is in favor of short castling, since White can generate minority attack or "f4 push" faster than the kingside pawn storm ( again see my answer to the question I linked above, if you need concrete explanations/examples ).

Since a positional player will always keep his options open and his king safe, castling short would be a good option, and is played most of the time at top level.

OK, this all sounds great but what about long castle? What about players who like sharp play?

White has healthy pawn structure at queenside, queen + bishop battery is directed on kingside, and Bg5 + Nf3 are aggressively positioned. White also has space advantage and better development, but Black can open c-file with ...c5 at some point. Therefore, based on the first factor, this should scare White a little. 

But notice that I stated that we must take opponents attacking chances as well. Black will lose a lot of time to prepare an attack, and even then White can just play Kb1 and simply use rook on d1 to pressure the d5 pawn after the dxc5 exchange. The point is that long castle speeds up White's development thus strengthening his development advantage and central pressure according to the third factor. 

This is the reason some GMs took the risk to castle queenside, claiming that Black is misplaced for queenside counter-attack so they counted that they will be faster on the kingside ( again, third factor is more important here then king safety ) which proved to be true. Therefore Black had to enter an endgame to keep equal chances ( again, see my answer I linked before ), but the second factor I mentioned helped White to still keep small pressure ( king is closer to the center and rook controls d-file, these are all important things in an endgame ). 

I could give you another example in Caro-Kann, but I have "ran out of steam" :(

The point is to do the same as I did in the above practical example:


Evaluate kings safety ( your pawn structure, piece placement, opponents attacking chances on that side of the board... );
See how castling long/short fits into your overall plan ( is there a high probability for an endgame to arise or do you need sharp position and so on... );
How fast do you really need to mobilize your forces ( do you need fast action in the center or can this wait; can you afford slightly exposed king to get sharp position with "opposite side castling" and so on.. );


If you need further help leave a comment. Best regards.