A totem pole consists of two transistors, which are driven complementary.One transistor pulls the output voltage down, the other transistor pulls the output voltage up. Depending on the desired output, only one of the two transistors is conducting.
Two totem pole outputs should never be tied together. If two totem pole outputs are connected, a shortcut occurs if they carry different digital signals (0/1 or 1/0) , it means If one output voltage is high and the other low , the "pullup" transistor of the first gate fights the "pulldown" transistor of the other. This is one of the most frequent causes of burned out chips