According to
https://boardgames.stackexchange.com/questions/11479/why-is-card-counting-considered-illegal-in-blackjack, card counting isn't considered illegal. This isn't cheating in any sense of the word. 994 P.2d 1151 (2000) CHEN v. NEVADA STATE GAMING CONTROL BOARD and Monte Carlo Resort & Casino:
This case presents a conflict between two inconsistent public policies that have developed over the years with regard to the gaming industry. On one hand, gaming establishments have the unquestioned right to protect themselves against so-called "card counters" who have developed expertise in the game of "blackjack" ("twenty-one"). On the other hand, neither card counting nor the use of a legal subterfuge such as a disguise to gain access to this table game is illegal under Nevada law.
But unfortunately, the source page of CHEN v. Nevada is not available anymore.
According to
https://www.quora.com/Why-is-card-counting-considered-illegal, count cards is not illegal, as it said on that page:
No, it is not illegal to count cards as long as it is JUST YOU doing it without any technology, and you don’t use any trickery or signals or anything else to communicate with someone else.
But we know that the casino has their own rule so they can easily to said that is illegal or legal to the players.
Casinos have the right to deny service to anyone, and of makes sense to deny players from playing a game in which they have an advantage versus the house.
So perhaps, one casino considers that counting cards are illegal, and they will ban the player from using that method. But in the other casino, counting cards is not illegal, and the player can use it as long as the player is doing without any technology. Well, that will depend on where you play the game
You will find many interest article on Google about counting cards is illegal or not, and they will have a different opinion about that. We should follow the rule in the casino, so they don't ban us from the games.