You are maybe coming from this article explaining how the King moves. If you do not know how it moves, I suggest you to check it as well.
To sum up how the Rook is moving, it moves as far as it wants, but only vertically and horizontally.
This is all you have to now about how the Rook moves. Capturing an enemy piece with the Rook works the same way than the other pieces, as well as the interaction with friendly pieces.
In case you are learning Chess, your next step should be to learn how the Bishop moves.