A triphthong is a sequence of three vowels making up one syllable. Some examples in Spanish would be: a – pre – ciáis, co – piéis, buey. For a triphthong to exist, two closed atonic vowels (“i” or “u”) and, between them, an open vowel (“a”, “e”, or “o”): anunciáis, guau, miau, confiéis.
Sequences of closed vowel + open vowel + closed vowel are not triphthongs when one of the closed vowels is tonic. Instead, there is a hiatus followed by a diphthong when the first closed vowel is tonic: vivíais (vi – ví – ais); or a diphthong followed by a hiatus, when the second closed vowel is tonic: limpiaúñas (lim – pia – ú – ñas).
A sequence of atonic closed vowel + open vowel + atonic closed vowel can be pronounced, in certain cases, as one syllable, a triphthong, and in others as two distinct syllables, with a hiatus followed by a diphthong, or vice versa.
Thus, the sequence “iei” is pronounced as a triphthong in the word “cambiéis [kam-biéis] and as a hiatus + diphthong in “confiéis” [kon-fi-éis], at least in Spain and the Latin American countries in which the tendency to remove hiatuses is not as strong. However, for purposes of graphic accenting, any sequence made up of an open vowel between two closed atonic vowels will always be considered as a triphthong, regardless of its actual articulation in one or two syllables.
Source: Real Academia Española