Basically, it's generally following the Judeo-Christian 10 Comandments (except the ones dealing with worship, of course), the Golden Rule, and Jiminy Cricket's advice, "Let your conscience be your guide."
However, Marine Corps General, Gen. James "Mad Dog" Mattis, had a quote which will make it somewhat simpler to explain. I have taken the liberty of changing his original words a little to be a tad bit more expansive than his original thought.
A Moral Code:
"I come in peace. I mean you no harm. I will help you and yours if I can. I will not bother you. But, you should believe me on this: I am pleading with you with tears in my eyes, If you harm, or try to harm, me, my family, or those for whom I care or if you try and take what's mine, I'll kill you all."