Basically, what most of them said but the best way to tell is if the said pokemon can be used in a wifi-battle. This is usually the best way to find out if its illegal or legal. If its illegal, a prompt will appear saying "You cannot battle with the other person's party". Have your battle partner and yourself check your entire team until you find that illegal mon. Also, be sure to check abilities as well. Another thing to look out for is when someone says they went through pokebank and that "You cannot battle" prompt appears, never believe what they ask cause passing through pokebank =/= it being a legal mon.