As Black , I would say to castle on the king side because white's pieces comparatively have more control over the queen side which holds a potential threat . Also in most cases it is preferred to build a strong pawn chain on the side opposite of the castled king so as to avoid an attack on the king.
Which side of your own pawn chain should you castle? (As Black)

From this position you cannot legally castle.
I know. But in the next few moves, I would be choosing moves such that I could castle asap. So which side should I plan in advance to castle from?

As Black , I would say to castle on the king side because white's pieces comparatively have more control over the queen side which holds a potential threat . Also in most cases it is preferred to build a strong pawn chain on the side opposite of the castled king so as to avoid an attack on the king.
Is that because the light squared bishop and the opening for the white queen?

I would castle K side, since it will take white a long time to get enough pieces on that side of the board to launch a meaningful attack.

You should usually castle on the side of the board where you control more space.
In the above example, that's the King's side.
You should generally castle king's side,
except when you want to advance your h- or g-pawn with support of a rook.
- King's side castling takes one less move.
- Queen's side castling takes a premature queen move.
- Queen's side castling requires an additional king move to the b-file for safety.
- Illustration: the pawn chain is such that black attacks on the king's side and white on the queen's side, but both sides castle king's side.
https://www.chessgames.com/perl/chessgame?gid=1070932
People who say "castle king always" never get hit by a huge attack right afterwards? If opponent has aimed all their pieces + advances pawns king side, maybe castle queen or not castle at all would work better? Casting often increases safety but never guarantees it...
@10
"People who say "castle king always" never get hit by a huge attack right afterwards?"
++ A huge atttack calls for precise defense.
Here is an example: 13...O-O
https://www.chessgames.com/perl/chessgame?gid=1008390
"If opponent has aimed all their pieces + advances pawns king side, maybe castle queen or not castle at all would work better?" ++ It depends on the position, but O-O is usually safest.


As a very generalised rule: whichever way your pawn chain is pointing is the way you want to attack and the pawn chain in the image above was pointing towards the kingside. It is much harder to start a pawn storm when your king is behind the pawns so personally I would castle queenside. You may be able to start an attack with 0-0-0 Ne7 and f5 followed maybe by Rg8 ?
This is just what I would play it is not necessarily right.

... It is much harder to start a pawn storm when your king is behind the pawns so personally I would castle queenside...
Not so.
In attacks on opposite wings, your King is safest behind your own Pawn storm, rather than in front of the enemy Pawn storm.

... It is much harder to start a pawn storm when your king is behind the pawns so personally I would castle queenside...
Not so.
In attacks on opposite wings, your King is safest behind your own Pawn storm, rather than in front of the enemy Pawn storm.
Really??? Wow ok but surely it would depend on the position and where blacks pieces are?
Also, wouldn’t you want a rook behind the h pawn?

I don't think the direction your pawn chain is facing is a good general guide to where you should castle. Here you should most definitely castle K-side, because:
- It's quicker. You just have to play Ne7 and castle and you can get on with business, because...
- You REALLY, REALLY want to play f5 in this position. That should be what all your play is organised around. Having a rook on f8 and a knight on e7 will mean f5 comes with more power behind it
- Some of White's pieces are locked on the Q-side. For example, if there were no pawn on d5, playing O-O and f5 might risk opening the diagonal for the bishop, which would be a consideration at least. In this position there are no such concerns.

Another example, from one of my own games, of putting the King behind your own attack instead of in front of the enemy attack. My opponent (Robert Hamilton) later peaked at over 2400 FIDE. That's OTB FIDE, not an online rating.

I mean Black ends up having to castle Q-side there, castling K-side would be suicidal.
In my experience, the rule-of-thumb is "My King is safer hiding behind my own attack than it would be sitting in front of my opponent's attack".
After all... if your King is sitting behind your own attack, the opponent would have to cut through half of your army in order to reach it.
Say you are playing as Black and have a set up where you have a three-pawn pawn chain on the queen’s side, the first of which is on c7 and the last of which is on e5. Neither of your knights are developed yet.
In general, should castle in the direction your pawn chain is facing (if the vector of the pawn-chain goes from pawn nearest the rank your king is on to farthest away from it, that is, “under” it), or in the opposite direction?
Hopefully this image posts so you can see the situation. Which side should I castle to as Black?