Rooks move any number of vacant squares horizontally or vertically. They may capture enemy pieces at the end of the line.
Move the rook to g2 by first moving to d2 then g2.