The rooks will actually never get captured. When I talk about capturing move I mean the piece must move the same way as it does when capturing pieces when moving through the rook. So since pawns needs to move diagonal forward when capturing they need to move through the rook by moving diagonally forward when they want to capture something.
So in example 2, the knight is just moving through the black rook to capture blacks knight.
In example 7, white can not move a rook to f5. Black on the other hand was able to move a rook to f5, since his pawn on f7 has a legal move to move to f5.
i think you have a mistake in example 2 white can't capture the g8 knight if he just moves through the black rook, correct? he has to capture it.
also, i don't understand how in example 7 white can move the rook to f5