The protocol for greeting heads of state can be a minefield. Getting it wrong can lead to a diplomatic faux pax that cannot be undone and can damage relations between countries. Understanding the protocol of the country that you are visiting is essential.
Greeting the President
It is usual when greeting the president of the United States to wait until the president approaches you, or until you are called upon. You should then shake the president's hand. There is no need for genuflecting, bowing or curtsying. You should not attempt to kiss or hug the president. If you feel you want to say something, say "Pleasure to meet you, Mr. President" or "An honour to meet you, Mr. President."
Royalty, unlike elected heads of state, may have less power (for example, Great Britain), but there is certainly more protocol attached to meeting the queen. There are many "dos" and "don'ts" to be followed. You should always stand when the queen enters the room. You are not expected to genuflect, but a small bow from the neck from a man or a small curtsy for a woman is an acceptable form of greeting. If the queen offers her hand, you do not shake it but gently touch it. Your first address to the queen would be "Your Majesty." Further comment addressed to the Queen should be proceeded with "Ma'am." Other members of the royal family should be addressed as "Your Royal Highness" and then followed by "Sir" or Ma'am" accordingly.
Other Heads of State
Depending on the country, protocol will differ. In countries such as France, it is usual to kiss on the cheeks as a formal gesture of greeting. In Japan, bowing to the emperor from the waist is considered to be the correct protocol.