When the two records have same external id means the first record will be upserted then the second record is not upsert, It throw some error message. Because of you have used the same external id in both records.
Karanraj correctly answered the question that was asked, but to clarify for others who may be searching for answers...
Scenario 1 If two records already exist with the same External ID, then trying to Upsert based upon that External ID will give the following error: "[ExternalIDFieldName]: more than one record found for external id field: [recordID1, recordID2, etc.]"
Scenario 2 If one record exists, but you're making two Upserts to the same External ID with a batch update (like Data Loader), then both rows will get the following error: "Duplicate external id Specified: [externalIdValue]"
Exception: For Scenario 2, if you have set the data loader batch size to 1, then both updates will succeed, but the values set by the second upsert will overwrite the values set by the first upsert.
When you upsert and there are 2 same external ids; salesforce send you the total of rows that exists and give you the primary keys (salesforce ids) that you should you use to achieve upsert one bye one; in this case i upsert to 2 same external ids, but the API send me the 2 ids that i need to use to upsert one by one.
I think it will be helpful for you.
Scenario 1
If two records already exist with the same External ID, then trying to Upsert based upon that External ID will give the following error:
"[ExternalIDFieldName]: more than one record found for external id field: [recordID1, recordID2, etc.]"
Scenario 2
If one record exists, but you're making two Upserts to the same External ID with a batch update (like Data Loader), then both rows will get the following error: "Duplicate external id Specified: [externalIdValue]"
Exception: For Scenario 2, if you have set the data loader batch size to 1, then both updates will succeed, but the values set by the second upsert will overwrite the values set by the first upsert.