Grammar related question, please [migrated]

What does the second 'they' stand for from a grammar point of view?

I like dogs, they like hoops, they are my friends.


Solution 1:

"They" can only refer to "dogs".

The written sentence contains a writing error. There are three independent clauses. There should either be three sentences, or three clauses joined with semi-colons, or three clauses joined with conjunctions.

I like dogs. They like hoops. They are my friends.

There is no grammar rule for working out what a pronoun refers to. You always have to understand in context. In this (artificial) example there are two possible plural nouns that "they" could mean: "dogs" and "hoops". Grammatically "they" could refer to either. But "hoops" are not alive and so can't be friends. On the other hand, dogs are friendly animals. So "they" certainly means "dogs".