When visiting a different country, it is customary to fly your countries flag off the stern of the boat and the flag of the country you are visiting on the starboard flag halyard (located under the starboard spreader).
When you arrive in a new country and have not cleared in yet, you will fly a yellow flag in this place, indicating that you have not cleared into customs yet. Once you have cleared in, you will then replace the yellow flag with the flag of that country.
The boat in the image above has an American flag flying from the stern and the Bahamian courtesy flag flying from the starboard spreader. This is the appropriate flag setup for an American vessel visiting the Bahamas, but not the correct flag setup to find in Fort Pierce, FL.
This guy is our neighbor while we are on a mooring ball in Fort Pierce! I'm not sure if he simply forgot about the flag, or if he hasn't cleared back into the US, or what the situation is? The important thing to remember is that flags are signals that you send to other boats around you and it is important to be mindful of this and make sure that you are always sending the correct signs.