Upvote:10
I routinely travel with two passports (US and non-US). General rules here, assuming you want to use another passport to enter:
On departure you show the airline both passports, and explain that you're going to use another passport to enter the country. Never been an issue;
On arrival in the destination country you show the passport control your other passport. Since you're shown as arriving from an US flight, and your passport has no valid US visa, a border control agent might want to see your Green Card/US passport; this only happened once to me.
When leaving the destination country you show the airline both passports, and show the passport control the same passport you used for entering it. The border control agent might ask to see your US passport if your passport has no US visa and is not eligible for VWP (this always happens in Russia and Ukraine, and once happened in Vietnam).
When you arrive in the US, you only show the US passport. If CBP agent find out there are no exit/entry stamps and asks if you have another passport, you show them your other passport too. Only happened once to me.
Now, potential problems/issues:
Several countries (at least Malaysia and Thailand in my experience) are very picky about seeing the exit stamps from the country of your departure when you cross the border overland. Thus for example leaving Singapore using one passport, and trying to enter Malaysia overland with another passport may get you in trouble; I know a person who was denied entry because he did not have the exit stamp in the passport he presented (and his other passport was not eligible to enter Malaysia). Other countries (Nepal, or EU, for example) could care less about them. This may be an issue for you if you are visiting other countries besides Iran.
Since you entered Iran with your other passport, if you get into any kind of trouble, Iran might not recognize you as US citizen but only a citizen of other country. Thus getting the US consular protection might be significantly more difficult, or even impossible, and the consular protection offered by the other country might be much less accessible.
If you lose your other passport in Iran, you will not be able to leave Iran for US despite having a valid US passport, as the passport control will not let you through. Check the rules of your "other country" embassy if you're a tourist and lost your passport - some countries only issue in this case a so-called "home return travel document" which will only allow you to border a flight to "home" - i.e. the other country, but not to the US;
If your name spelling is not exact match in both passports, you'll have to book hotels and internal flights using your other passport (hotels very often want to see the matching ID with visa/entry stamp). And if your credit card has your US passport name spelling, you might need to file extra paperwork (such as 3rd party authorization forms) or explain this to agency - most likely with the copies of both passports .
Note: this answer assumes your other passport is not Iranian, you are not eligible for automatic Iranian citizenship (i.e. you weren't born in Iran), and you were not an Iranian citizen before. If any of those applies, you'll have a much bigger set of possible issues.