Here it probably gets as hard as the five tones of Mandarin were for me.
There is no hard and fast rule. Even the same multisyllable word may be pronounce two different ways and still be correct ("caribbean")
What you must realize is that one of the stresses is secondary and will be less than the primary.
In the case of "egalitarian" the 2nd syllable is the secondary and the 4th is the primary.
This means the 2nd syllable is stressed above syllables 1,2,5 and 6, but less than the 4th. e GAL i TAR i an [ I know they look the same, but trust me - GAL is smaller than TAR.
It only comes with experience and there's no way to look at a multi-syllable word and know where the stresses are.