I would add that if the d-file is clear of your own d-pawn the 0-0-0 gets the rook into early action.
when to castle long

The game in the above post is certainly not ideal, but I was quite happy with it because in the past, one of my weaknesses has been an unwillingness to abandon plans when they started to look unfavorable. After 6 or 7 moves, I thought that I would castle kingside and look to play on the light squares since his f-pawn had moved, but reevaluating after 9...e5, I realized that plan had no real scope. With his dark squared bishop missing though, I could change gears and look to play on the dark squares, as well as eventually push h4-h5 and try to use his advanced kingside pawns against him.

When the a, b, and c pawns haven't moved yet. When your opponent doesn't have a space or force advantage on the queenside. When your opponent doesn't have a pawn break on the queenside. When you can attack or have an initiative on the kingside, especially when it involves moving your f, g, h pawns.
Things like that.
In practice 0-0-0 may be less common because it takes a little longer (3 pieces have to move out of the way instead of 2 for 0-0). Also the king is slightly less safe. 0-0-0 is often combined with Kb1/8 while 0-0 is often combined with Rf1/8 to a center file.
any helpful tips would be nice.