What about France? Is it half way into Spain because its weighted towards French Guyana?
What about Reunion? Then it should be roughly in the middle of Africe.
If you weight it by the actual size of territories rather than just the extreme boundaries then the center is indeed in Spain, because the overseas regions are still rather small in comparison to the European part of France.
If you use only the extreme boundaries then it gets a lot more interesting and I would say that the center is closer to the center of the Earth than to its surface.
Things probably change if you weigh by surface including the ocean EEZ, with French Polynesia being the most significant area of France at this point.
That’s not generalizable to every country though.
Rule could be it’s the center of the geography they’re showing you. If they actually put Guam on the USA map then it’s included. If not, it’s not.