If it's in your contract where you promise not to work for anyone else without telling your employer, yes, it's illegal because breach of contract is illegal. But it's not illegal in its own right. However I doubt that they didn't make him sign a contract to the contrary so he's probably double dipping.
Contracts don't determine what is legal and not legal. If the said person is found out then they would be in breach of contract and could be fired or sued. They would not earn themselves a criminal record.
They could earn themselves a criminal charge if the court decides what they're doing is fraud which it likely is if they have signed something saying they wouldn't work elsewhere simultaneously.