The categories "comet" and "planet" both date back to at least the ancient Greeks.
Halley's Comet, with its long tail, is clearly a comet, not a planet.
The concept of "planet" has changed several times as astronomy has learned more about the heavens.
Many observers thought of five planets, visible to the naked eye: Mercury, Venus, Mars, Jupiter, and Saturn. Ptolemy's model of concentric spheres included the sun and the moon among the planets, as they similarly move across the background of fixed stars.
The heliocentric model introduced the concept of planets as things that orbit the sun, which meant Earth was then included as a planet, but not the moon or the sun itself.
In the 1800s, a number of new wandering bodies were discovered: asteroids like Ceres and Vesta, but also Uranus and Neptune. So many new planets were discovered, most of them very small, that astronomers divided "planet" into two categories: "asteroid" for the small ones and keeping "planet" for the big ones.
In the 1900s and early 2000s, many more bodies were discovered out beyond Neptune. The first discovered (Pluto) was considered a planet, but just like Ceres and Vesta it was moved to a new category of "minor planets" once so many more things like it were discovered, such as Eris and Sedna.