> It is a defense to any offense that the accused was acting pursuant to orders unless the accused knew the orders to be unlawful or a person of ordinary sense and understanding would have known the orders to be unlawful.
So for those non-military reading, while it's almost always a bad idea to try to sea-lawyer your way out (though some court challenges have worked), you also are expected to use "ordinary sense and understanding" to reject orders like "go massacre those clearly unarmed noncombatants." But if it's not as cartoonishly obvious as that, there's a good chance you will have to defend your actions at a court-martial, and the legality of the order will be down to the interpretation of the presiding military judge and appellate courts.