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.