The crude oil is heated in a process of fractional distillation (note: you can research this online if you require more detail) and this process causes different hydrocarbons to condense at different heights up the distillation column. They will therefore run down the side of the column and into different areas depending on their boiling point.