Your passed pawn wants to run, and his king wants to get in front of it. The rule: first cut his king off with your rook along a file, then keep that cut-off while your king walks up the board with the pawn. Here the cut-off is along the f-file, two files from your pawn.