From what I can tell, hitting an enemy in the head before finishing them with a couple shots to the body does not count as a headshot, but the inverse—hitting them in the body a couple times before finishing them off with a headshot—does count. I find this frustrating.
I'm sure I'm not the only one bothered by this when trying to do a headshot-focused daily mission; I often get a nicely aimed headshot on an enemy, but they survive it before my follow-up shots finish them off. Why shouldn't this count as a headshot like when the hits land in reverse order? Due to recoil, I think the success of the first shots in a sequence are determined more by skill than the latter ones. You get rewarded when spraying down an enemy, getting lucky, and having the killing blow hit the head, but you're left left disappointed when you carefully line up a headshot, only for them to die to a subsequent errant body shot.

