Surnames that Codsworth supports
There is a list of all names (Given names and Surnames)* that Codsworth recognises, without using additional mods.
They are, however not separated, merely ordered alphabetically. My bet is that names that are put in the "first name slot" and "last name slot" will determine whether or not he calls you "Adam", or "Mr/Mrs. Adams".
Additionally, I don't believe that there is a "middle name slot" that is recognised, and could potentially throw the whole thing out, resulting in Codsworth simply referring to you as "Sir" or "Ma'am", and determiners like "the" would be a cause of this.
*NSFW Warning