@ChrisJWilson in that situation there’s a couple reasons why you can’t castle. One is that you can’t have any pieces between the rook and the king. Another reason is that the king would be in check, and you can’t castle while in check. Another way to describe the rule I’m talking about is to say that castling is not allowed if the king is under a direct attack, move through any direct attacks, or end under direct attack.