A homonym is each of two or more available specific or subspecific scientific names with the same spelling, that have been established for different nominal taxa.

A junior homonym is the youngest (latest established) of two or more  identical scientific names established for different nominal taxa of the same rank.
A senior homonym is the oldest (first established) of two or more identical scientific names established for different nominal taxa of the same rank

The senior homonym has precedence over the junior homonym.

A primary homonym is each of two or more identical scientific names established for different taxa, originally combined with the same generic name.
A secondary homonym is each of two or more identical scientific names established for different taxa, but only subsequently combined with the same generic name.

Example - Holothuria maculata Brandt, 1835, Holothuria maculata Lesueur, 1824 and Holothuria maculata Kuhl & van Hasselt, 1869 are all three junior primary homonyms of Holothuria maculata Chamisso & Eysenhardt, 1821 and are invalid. These three names are to be rejected and replaced, either by an available and the oldest valid synonym, or – if no such name exists – a new subsitute name. For instance Holothuria maculata Brandt, 1835 was replaced by its valid junior (=later established) subjective (=based upon scientific judgement) synonym Holothuria nobilis (Selenka, 1867).