Targeting by COC is a story bug
For example, Momo and the others were not affected by Shanks' COC, but GB was affected by Shanks' COC from 100 km away, and at the same time, Shanks' crew was knocked unconscious by COC
This is not a clear thing, for example, when Luffy used COC in Chapter 1049, as far as I remember, only Kaido's soldiers were knocked unconscious, and not even the samurai or Chopper were affected by this power
However, it seems that Shanks has the highest control over COC, if Oda does not forget his writings, we saw on the Whitebeard ship that only the forage that got closer to Shanks than a certain point were knocked unconscious, and Marco and the others were out of that certain distance. It seems that Shanks only used this ability within a few meters around him