It's almost a direct adaptation of Jung's theories for the most part (read "Psychological Types"). First, you have the dominant function and the inferior function. The opposing pairs are:Also, I think the exact hierarchy of the lesser functions may vary a bit. I'd like to see why the "code" is the way it is.
Thinking vs. Feeling
Sensing vs. Intuition
If you have one in a given pair as dominant, the other must be the most repressed, and hence the weakest, leaving the other pair to be auxiliary and tertiary. Your auxiliary function is the second most preferred function from the other pair. If the dominant function is Extroverted, the inferior will be Introverted, and vice-versa, because they will work to oppose the other. In a healthy individual, the auxiliary will also be in the opposite (I/E) realm from the dominant to allow them to deal with the opposite realm.
This defines the positions/attitudes of the Dominant, Auxiliary, and Inferior, but the reason for the attitude of the tertiary is just a guess. Some believe that an Introvert extroverts all three of their weaker functions, and an Extravert introverts all three of their weaker functions. Others (particularly Beebe) believe the tertiary is the same attitude as the dominant.