It is the universal custom to display the American flag only from sunrise to sunset on buildings and on stationary flagstaffs in the open. However, when a patriotic effect is desired, the flag may be displayed twenty-four hours a day if properly illuminated during the hours of darkness.
1. When displayed either horizontally or vertically against a wall, the union should be uppermost and to the flag's own right, that is, to the observer's left. When displayed in a window, the American flag should be displayed in the same way, with the union or blue field to the left of the observer in the street. No other flag or pennant should be placed above, or, if on the same level, to the right of the flag of the United States of America, except during church services conducted by naval chaplains at sea...for personnel of the Navy...when the church pennant may be flown above the flag.
No person shall display the flag of the United Nations of any other national of international flag equal, above, or in a position of superior prominence or honor to, or in place of, the flag of the United States at any place within the United States or any Territory of possession thereof; provided, that nothing in this section shall make unlawful the continuance of the practice heretofore followed of displaying the flag of the United Nations in a positions of equal prominence of honor, and other national flags in positions of equal prominence or honor, with that of the flag of the United States at the headquarters of the United Nations.
2. When flags of States, cities, or localities, or pennants of societies are flown on the same halyard with the flag of the United States, the latter should always be at the peak.
3. When the flags are flown from adjacent staffs, the American flag should be jousted first and lowered last. No such flag or pennant may be placed above the flag of the United States or to the United States flag's left.
4. The American flag, when it is displayed with another flag against a wall from crossed staffs, should be on the right, the flag's own right, and its staff should be in front of the staff of the other flag.
5. The American flag should be at the center and at the highest point of the group when a number of flags of States or localities or pennants of societies are grouped and displayed from staffs.
6. When flags of two of more nations are displayed, they are to be flown from separate staffs of the same height. The flags should be of approximately equal size. International usage forbids the display of the flag of one nation above that of another nation in time of peace.
7.When used on a speaker's platform, the flag, if displayed flat, should be displayed above and behind the speaker. When displayed from a staff in a church or public auditorium, the flag of the United States of America should hold the position of superior prominence, in advance of the audience, and in the position of honor at the clergyman's of speaker's right as he faces the audience. Any other flag so displayed should be placed on the left of the clergyman or speaker of the right of the audience.
The flag, when flown at half-staff, should be first hoisted to the peak for an instant and then lowered to the half-staff position. The flag should be again raised to the peak before it is lowered for the day. On Memorial Day, the American flag should be displayed at half-staff until noon only, then raised to the top of the staff. By order of the President, the flag shall be flown at half-staff upon the death of principal figures of the United States Government and the Governor of the State, territory or possession, as a mark of respect to their memory.
In the event of the death of other officials of foreign dignitaries, the flag is to be displayed at half-staff according to presidential instructions of orders, or in accordance with recognized customs practices not inconsistent with law. In the event of the death of a present or former official of the government of any State, territory or possession of the United States, the Governor of that State, territory or possession may proclaim that the National flag shall be flown at half-staff.
Flags flown on poles affixed to a home or building are not to be flown at half staff but a memorial streamer may be affixed to the top of the flagpole.
Excerpts from The Flag Code of the United States -- Public Law 94-344, July 7, 1976.