Where's the game? It sounds like you gave up control of a critical file so they could penetrate your position and get their rook on the 7th or 8th, a common thing to be achieved. I'm only 1500 but I'll give you my advice on castling.
Castling = KING SAFETY :)
If the centre is closed delay castling, you might have to castle long or short depending on the situation and position.
If the centre is open castle immediately.
I believe a fianchetto castled king is a weakness and when I become more experienced I'll prove it. The petruding pawn is a target. The king's knight might need to remain at the king's side since a common strategy I always see is to rip him open by a pawn storm in the opening. If you lose that bishop there is a major square weakness around your king. If the king makes it to the endgame these weaknesses dissapear.




award.
This game is a prime example of why i dont castle its leave u at a severe weakness where the enem y simply has to move their rook down and they win