Who ever does the most damage gets the kill, everyone else who hit him gets an assist.
So just as an example... all numbers are fictitious!
Say it takes 500 hits to cause "fatal" damage on a pony. Your in a P47 with 50s and you get 5 points per round you hit with. You pump 40 rounds into him and do 20 points worth of damage.
Your teammate comes in to help clear your 12 oclock
and he's in a nik. His cannon rounds are worth 20 points per round. He pumps in 15 rounds as he blows by... almost a third less rounds than you, but his total adds up to 300, plus your 200, and the pony goes down, and the nik gets the kill.
Same goes the other way, if the nik hits him first and you finish him off 5 minutes later as he's landing
his 300 still beats your 200 and he still gets the kill.
Again the numbers are all fake, but that is pretty much how it works.