What the international law cares about is “sovereign states” or “sovereign subjects of international law” not countries which is a much more informal term. Sovereign states technically don’t even need a territory - 122 states have official diplomatic relations with the Sovereign Military Order of Malta (not to be confused with the Republic of Malta) which has had no territory since 1799.