Add a trigger, type All Present, Repeatedly, with a radius covering the area where your units will be. Name the trigger, for example "triggerAll"
You can these access it through script as "list triggerAll", which will return an array of all units in the trigger radius.
To count airplanes, use
planeCount="Plane" countType (list triggerAll)
or
heloCount="Helicopter" countType (list triggerAll)
or
airCount="Air" countType (list triggerAll)
for both.
"planeCount", "heloCount", "airCount" are just variable names I made up for the example, you can use any name.