there is unit_killing_score_table
every unit have his own killing_score
when player kills unit and if it was unit of other player or comp
he will get +killing_score of this unit
AND additionally +500 score at the end of game for victory
when you playing campanign - score from from previous levels being saved to next levels.
and the main factor of all this - units killing_score can be changed with map editor cuz they all stored in PUD
ONLY kills of units of other players are affect score
none other actions cannot change it in any way
making untis or harvesting res not affecting score at all