* Comets can be seen when they get close to the Sun, not necessarily Earth. The Sun's heat causes the comet's ice to sublimate (turn directly into gas), creating the beautiful tail we see. This is often when they're at their brightest.
* Some comets pass close to Earth, making them even more visible. If a comet's orbit brings it close to our planet, it can become a spectacular sight in the night sky.
* Not all comets come close to Earth. Many comets have orbits that take them far beyond Earth's reach, and we may never see them.
So, to sum it up: You can only see a comet when it's close enough to the Sun for its ice to sublimate and create a visible tail. Sometimes these comets also happen to pass close to Earth, making them even more prominent.