Well, unfortunately, there are some exceptions. They are driven by their sound:
If there is something that sounds similar to "i" after the y (AND), then y changes to e.
- Pedro e Iván
- padres e hijos
- único e irrepetible
It's the same with o (OR): if a similar sound follows, it changes to u.
- Juana u Olga
- siete u ocho
- amar u odiar