How can we spot planets in other galaxies when we can’t even be certain how many planets are in our solar system?
It has everything to do with the available means that we have, for now. For the record though, we haven't yet been able to spot planets in other galaxies, just in our own Milky Way. The spotted ones just happened to be there when we decided to look, twice. To spot an astral body properly sized to fit the definition of planet, which we yet suspect to orbit around our own star, we should be lucky enough to look exactly…
https://science.nasa.gov/universe/exoplanets/exoplanet-disco...