There are quite a few ways to do it.
What I would do (there may be an easier way to do it), is something like this:
;start of script, run near end of mission
;apgrp is the name of the player's group
;let's say there are 8 loons in the players group
{alive _x} count units apgrp == 8: goto "End1"
{alive _x} count units apgrp == 7: goto "End2"
{alive _x} count units apgrp == 6: goto "End3"
...and so on
#End1
<insert commands here>
end1=true
exit
'End1', 'End2' and 'End3' are all sections placed within a script. You can put whatever you want in each section. You can have a camera sequence for example, which ends with the corresponding 'end#', which is followed by the debriefing screen.
There are loads of different ways to do what you ask, but that's probably what I would do
You can do all of this with triggers as well, if you don't want to use scripts.
It's been awhile since I last touched the editor, so syntax is not guaranteed.
Hope this helps
Gruntage