In my experience, you get scores every time you get the "Enemy aircraft: Destroyed", or "Enemy Tank: Destroyed", etc. message on the right of my screen. Sometimes this messsage doesn't show up, even if it's clear that i got the kill (doesn't happen with ground kills).
Someone with more experience in this area maybe could explain that part.
There's also the fact that if your sortie lasts less than the "victim's" sortie, then you don't get the kill (this only applies to situations where the bogey escapes badly damaged and crashes on landing attempt for example).
A healthy recommendation... don't mind much about the online scores

, fly and fight just for the fun of it.