The US flag is flown all over the United States, and while it may occasionally be at half-mast, it is almost always flown right side up, with the stars in the upper left corner. However, in some very rare cases, you may see the US flag hanging upside down. There are very few reasons why this would happen, but they do exist.
Indicating a Serious Emergency
Officially, there is only one reason the US flag should ever be flown upside down. According to United States legal code, the flag can only be displayed this way to signal “dire distress in instances of extreme danger to life or property”. In other words, if you had no other way to signal to others that you needed help due to an emergency, you could do this.
Such an emergency could include something like a sinking ship that required assistance from other vessels. There is no specific type of emergency that allows for the flag to be flown upside down. However, the validity of the emergency would likely be assessed by those responding to it after they saw the flag.
For example, if a ship were to carry the US flag with this reverse orientation simply because they were experiencing some minor trouble with the engine, that would not be a valid emergency to warrant flying the flag upside down. In order to justify flying the flag this way, there must be an extreme and immediate danger to life or property.
Officially, an upside down orientation of the American flag for political protest is not allowed. However, many citizens choose to do this anyway when they are protesting some aspect of the American government. Protests may hoist the flag in this manner at their home, carry it upside down in a protest, or fly it in such a manner elsewhere.
This particular action is actually illegal in the United States. If you are not in an extremely dire and threatening situation, you cannot legally fly the flag upside down, as this does not fall under the protections of free speech. That said, people are rarely arrested or fined for this, simply because of the lack of real harm being caused by the crime.
When it comes to protests, law enforcement often has bigger concerns than the flag being flown upside down, so it is rarely penalized there either. Even so, flying the flag upside down for political protest (or any reason besides a serious emergency) is illegal, and the government would be within its rights to penalize such actions.
Other than these two reasons, the US flag is effectively never flown upside down. There are no other official reasons to do so other than the one listed, and there is no reason to do so as an individual unless you want to make a statement against the government or nation as a whole. That said, these are the reasons the US flag may be flown upside down.