Initially luggage restrictions follow the rules of the country in which you book your flights. If you book a code share flight with a USA airline in the USA and they code share with a European airline the USA company restrictions apply. However if you transfer to a low cost version of the airline restrictions may vary. It is best to book with a travel agent and check the rules at the time of booking. Maybe even get it in writing.
We fly with Iberia on a regular basis, they code share with American and we have never had a problem. Iberia fly into New York, Miami, Chicago, Boston and I think Washington (although this flight may not have started yet). Onward flights are booked through American, or sometimes United.
Hope this helps.