My grandfather had a flag pole and flag, and it was an honored grandchild duty to be able to assist with the flag removal at sunset each evening. So, I learned parts of the Flag Code early. My family belonged to a country club that every summer raised and lowered the American and club flags, with instructions for the order of operations on this. And I was a member of Civil Air Patrol where the second leadership test, the one some people had to take a few times, was entirely about the flag. All of this to say, that I recognize that my exposure to Flag Code is greater than at school or the occasional sports game. Most people don't even realize that the reason you stand during the anthem at a sports game is because the anthem is accompanied by a flag (and these days often a full color guard).
But, not that it's too surprising, a lot of people, and I am being specifically American here, because I have no idea what the rules for this in Canada, the UK, or really any other country are, think they know the rules and can then lecture people who have violated them.
1. It is Federal Law*. As such it only applies on US soil. However, the only penalties associated with it are in regards to desecration of the flag, and even that part is not widely enforced. There sometimes are additional state laws, although after the Supreme Court ruling on flag burning a lot of those were dismantled. How do I know it's rarely enforced? Keep reading.
2. Flags should be displayed from sunrise to sunset. (And now you know why my grandfather usually got to hoist the flag alone. There are some exceptions, mostly for specific government buildings and if its lit, but there's nothing in there that says the lighting rule overrides the next rule.)
3. Flags should be taken down in the rain or other inclement weather.
4. On Memorial Day Flags should only be flown at half staff until noon, at which point they should be raised to full staff.
5. The flag should never touch anything - the ground, dangling in a manner that it touches merchandise, or water. If it does the flag is considered to have been desecrated, and should be appropriately disposed of.
6. The flag not to be placed on anything that is intended for disposable use. Napkins are specifically mentioned but I would have to imagine toothpicks fall under that rule also.
7. The flag is not clothing. Also, no part of the flag can be used as costume or athletic clothing. (The exception is military members in uniform are allowed to wear a flag patch.)
*This is not intended to take away from folks who have pointed out the right to protest. Protesters often block roads or do other things to grab attention as they protest. The grander point is that it applies to all of the citizens in the stadium. If you don't think the dude who kept chewing his hot dog during the anthem should be arrested, then I'm not sure why you care about anyone else.