As per rule, only the first player, who has been hit by the ball, has to go out of the court. While the other player has to remain in the court.