Priority in naming organic compound
The most important simplified criteria for the numbering of simple compounds are:


lower locants for suffixes
lower locants for multiple bonds
lower locants for prefixes
lower locants for substituents cited first as a prefix in the name


The corresponding actual wording in the current version of Nomenclature of Organic Chemistry – IUPAC Recommendations and Preferred Names 2013 (Blue Book) reads as follows:


  P-14.4 NUMBERING
  
  When several structural features appear in cyclic and acyclic compounds, low locants are assigned to them in the following decreasing order of seniority:
  
  (…)
  
  (c) principal characteristic groups and free valences (suffixes);
  
  (…)
  
  (e) saturation/unsaturation:
  
    (i) low locants are given to hydro/dehydro prefixes (…) and ‘ene’ and ‘yne’ endings;
  
    (ii) low locants are given first to multiple bonds as a set and then to double bonds (…);
  
  (f) detachable alphabetized prefixes, all considered together in a series of increasing numerical order;
  
  (g) lowest locants for the substituent cited first as a prefix in the name;
  
  (…)


Therefore, if no decision can be made about the locants for an ethyl and a methyl group using the previous rules, the lowest locant is given to the ethyl group according to Rule (g) because ‘ethyl’ is cited first in the name (since alphabetical order is used to establish the order of citation of substituent prefixes in the name).

For example, a correct systematic name is 4-ethyl-5-methyloctane rather than 5-ethyl-4-methyloctane since ‘ethyl’ is cited first in the name.