How do we detect when the planet is behind the star

How do we detect when the planet is behind the star