Look i am 48 years old. In good old games i.e. Karpow vs Kasparow in a time 1982 the rules were clear, even 0-0-0 was not possible if only one position between was threatened.-
The king cannot move through an attacked square. The rook can. The king can't castle if it is attacked. But you can castle if your rook is attacked. You can trust me on this, i know how castling works.
I think this is what you're referring to - your Bb2 is attacking his Rh8 and he castles out of it. This is legal, because it doesn't matter that the rook is attacked; only if the king is attacked.
The king cannot therefore castle if he is in check or would move through a square where he would be in check. Here, you aren't controlling the f8 or g8 squares, only the h8 square (which the king never touches) so castling is legal.