I was playing chess with an opponent. He had his queen in front of his king. I attacked the queen and he moved her, exposing his king directly to my rook. It was my turn to move, not his. We couldn't decide if this was a checkmate. We know that moving one's king into check is illegal. What happens however, if one removes a piece in front of his/her King and exposes him to checkmate unintentionally, as in this instance? If it's illegal to do this, but the player makes this move anyway, is he required to take back the move and move differently, or does the game automatically end? Thanks in advance.
It was illegal to move the queen here (and any piece in general) if that move put the king in check from another of the opponents pieces.
If the player tried to move the queen here they have to put it back and make a legal move.
Note that in some nonstandard variation most usually of the blitz speed type the special rules allow you to take the king and win if they make that illegal move.
Some other variations may allow claiming a win if an illegal move is made. I have played blindfold games where that illegal move was a loss by the special rules for that variation of chess.