"These are cars, while those are buildings."
Translation:Ezek autók, azok pedig épületek.
Pedig, when it is used with this "whereas" or "while" meaning, goes in the 2nd position after the comma. Usually you are joining two clauses that could each stand alone ("These are cars" and "those are buildings"), and usually they will have a parallel structure two each other. Pedig is almost like a postposition in the way it wants to come immediately after something (in this sentence, maybe think of it as "those-however" or "those-on-the-other-hand").