The order of the calls depend on where they are added. In your above code, the first "if" will always be called before the second "if". They also are not entirely identical: if "myAIGroup" is not a table with a "getSize()" method, for example when it's nil, some random string or number, the if-check will throw an error. So again, depending on how and where it's used, it's generally safer to do:
if not group or (group and group:getSize() == 0) then
-- ...
end
This first checks if the group does not exist (so is dead), or if it still exists, it should not have units.
There's also a small mistake in your snippet, getSize() should be with capital S.