The USA does not and can not know that you entered Iran if you do not tell them and have no stamps from Iranian Immigration in the passport you show to the US authorities.
2 passports always solve these kind of issues, just like the Israel-Saudi/Emirates issue by the way. This is also the reaon why my country issues 2 passports anyway. To eliminate entry restrictions when having visited third countries.