How do you know when the first compound is completely distilled and how do you know when the next compound starts
There is no such point when the first solvent is completely distilled and then the next one starts. From the very beginning, both solvents boil together, though the vapor initially is relatively enriched with the lower-boiling one. The cutoff point is set somewhat arbitrarily. And yes, the answer surely has something to do with temperature, because temperature is the only parameter we can control.

Like NotNicolaou said, if the boiling points of your solvents are reasonably far away, you may separate the mixture almost completely by collecting the fraction that distills near the boiling point of the low-boiling one. Otherwise, you might not be able to get pure compounds, unless you use an industrial rectification column.