Why can't I castle queenside in this situation? King hasn't moved and he is not in check.


Your King is not allowed to cross a line of check. If in the above position, you had a knight on d2, then you would be allowed to castle Q-side

if there is a piece a space you'll king will have o go through you can't castle
in this position, the rook on d8 is attacking the d1 square, and since
your king will go through that square you can't castle

Thank you. That is what I thought. But I googled castling rules and most of the time they omit that part of the castling rules.

I would play Nd5 in your position, your attacking the queen, knight has a good outpost and then you can castle