If the king or rook moves casting is illegal. The king can not castle into or through a check.
Castling Rules

Indeed you are correct. Here is a link to the rules, if you would like to show your opponent.

Now can someone tell my opponent the real castling rules?
You can't be serious?!
Tell your mutton head friend about google.
Hello Chess Players of all levels.
I know the rule for castling, either on the Queen side or the King side.
If neither the rook or the King has moved the castling is still posibble, or if the King will not be under check when it castles to either the King or Queen side.
Anyway the topic for the day is if the rook has moved and then went back to the original square either on A1 or A8, H1 or H8 which are the original squares the Rooks are place the castling is still posibble, this is according to a player who has been playing for many years, he says that he has done it many times, just because that is the rule. I told himn the correct rule and still claims that he won the game because I claimed the illegal castling move.
See diagram below:
Now can someone tell my opponent the real castling rules?