Use the noun ensign when you talk about a Navy officer. An ensign's rank is just below lieutenant and above a non commissioned petty officer or midshipman.
The lowest ranking commissioned officer in the US Navy is an ensign, and it's a similar position in the British infantry as well. You can also use the word to describe a country's flag or another symbol that represents a particular nation. For example, you might say that a ship displays the Norwegian ensign when it flies the flag of Norway. Ensign is a Scottish word that comes from the Old French enseigne, "mark, symbol, flag, or pennant."