The second interpretation is the correct one
You can sneak attack if ((you have advantage) or (an enemy of the target is within 5ft, etc)) and the attack is made using a finesse or ranged weapon.
D&D 5e rules work on the principle of Specific Beats General:
If a specific rules contradicts a general rule, the specific rules wins
(PHB > How ...
Sneak attack always requires an appropriate weapon.
Your rephrasings to use OR and AND are not valid rephrasings of the rule. You can use that sort of rewording to make the rules easier to remember or jot them down as notes, but the rules do not include a bunch of ORs; you're making that up yourself and introducing ambiguity that wasn't originally there.
The Sneak Attack rules, as you quoted them, say:
Beginning at 1st level, you know how to strike subtly and exploit a foe’s distraction. Once per turn, you can deal an extra 1d6 damage to one creature you hit with an attack if you have advantage on the attack roll. The attack must use a finesse or a ranged weapon.
You don’t need advantage on the attack roll ...
The right interpretation is your second one.
By RAW, a Sneak Attack can be done if a condition is met and the attacker wields a finesse or a ranged weapon. There are two conditions that can be met:
the attacker has advantage on the attack roll
there is an ally within 5 feet of the target, it is not incapacitated and the attacker does not have a disadvantage ...