This is not an issue that logicians typically care about because they begin their analysis of language in the post-parsing phase. The issue of how to parse language into meaningful tokens is a part of linguistics, not logic. In logic, they typically assume that the process of breaking down a sentence into phrases of individual meaning has been done and they ignore any issues that might be involved in doing so.
To untangle this issue, first we have to distinguish between a phrase type and a phrase occurrence. In the sentence "John only cares about John", the phrase type "John" has two occurrences. There is just one phrase type "John" in the whole world, but there are many phrase occurrences of "John". The simple term "phrase" is ambiguous as to whether it means a phrase type or a phrase occurrence and you have to figure out which is meant by context. The same is true of other grammatical terms like "name", "word", etc. Sometimes one is speaking of a name or word type and sometimes of a name or word occurrence. English is generally ambiguous about abstract objects in this way.
In logic, a "name" is a phrase occurrence that has no logical parts that have independent semantic function in that occurrence. It doesn't matter if the phrase occurrence has lexical parts so long as those parts have no semantic function in that occurrence, even if in other occurrences those parts do have semantic function. In fact, nothing about the construction of a phrase occurrence is relevant in logic if the phrase occurrence has no parts with independent semantics in that occurrence.
Note that in the above I was using "name" to refer to a phrase occurrence. The word can also be used to refer to a phrase type, and this might be called the lexical sense of the word. In this sense, a phrase type is a name if it is common for occurrences of the type to be used as a name. When you see "Brian Cox" in a sentence, "Brian" and "Cox", viewed as phrase occurrences (that is, just those specific instances in that specific context) are meaningless lexical tokens. Viewed as phrase types (that is, as English words) they are names, because each is a word that can be used as a name in other occurrences.
So, for example in the phrase
I met Brian Cox. Brian said...
There are two occurrences of the phrase type "Brian". The phrase type "Brian" doesn't refer to either occurrence; it refers only to the type. The phrase type "Brian" is a lexical name because it is used as a name in some contexts. Now, as to the occurrences in that example, the first occurrence is not a logical name because it is a meaningless part of a larger phrase. The second occurrence denotes Brian Cox and so that occurrence is a logical name. For the first occurrence, whether "Brian" is a name or not depends on whether you mean the phrase type "Brian" or the specific occurrence of "Brian" in that context.