First of all, you need to use legality checker to make sure your .pkm pokemon pass as legit. Then you have to make sure it only has attacks it can normally get.
If it is an event pokemon with it's event attacks, it needs to have the PiD matching it's event. This also means you can't edit it's ivs and go on wifi with it.
After all that, you have to make sure all the dates and xxH values are legit. For example, a gen5 pokemin with a 41h value other than 0 can not go on wifi as gen5 has no shining leaves.