In the following position, I am trying to play Rxd8, but it is not allowed. What is the rule that disallows Rxd8?p
[FEN "1r1r1bk1/5p2/p3p1pp/1p2P3/B1p2P2/K2R4/P1P4P/3R4 w - - 0 1"]
In the following position, I am trying to play Rxd8, but it is not allowed. What is the rule that disallows Rxd8?p
[FEN "1r1r1bk1/5p2/p3p1pp/1p2P3/B1p2P2/K2R4/P1P4P/3R4 w - - 0 1"]
Your king on a3 is in check from the bishop on f8. When you are in check, you must move your king, capture the checking piece, or interpose a piece to block the check.
I wanted to add a comment to the first answer, which is as precise as it can be, but I have no enough reputation, so I'll dare to add an extra note here:
Someone could argue (not Marius, who already showed his agreement with dfan's answer) that after Rd8 white's the bishop in f8 can't move because it's pinned by the white rook, and the way to refute that argument is that then Ba3, taking the white king, just finishes the game.