Overview
A flag protocol (or flag code) is a set of rules and regulations for the display of flags within a country, including national, subnational, and foreign flags. Generally, flag protocols call for the national flag to be the most prominent flag (i.e, in the position of honor), flown highest and to its own right (the viewer's left) and for the flag to never touch the ground. Enforcement of flag protocols vary by nation, with some countries using flag protocols as recommendations and guidelines, while some countries enforce violations of flag protocol with civil or criminal penalties.
Multiple countries, such as Argentina, Australia, Brazil, Canada, Chile, France, Germany, India, Japan, South Korea, the United Kingdom and the United States, use different flag codes.
General guidelines
The following guidelines are generally used between all countries.
Position of honor
The position of honor is reserved for the most prevalent flag. Typically, the national flag of the country in which it is being displayed. Following the national flags, flags of sub-federal divisions (such as states or provinces) typically follow and then other flags such as for armed forces or personal flags.
From Wikipedia (CC BY-SA 4.0).