Almost every glue commonly in use won't take stain, and one or two that are said to stain don't stain as well as you'd like (similar story with 'stainable filler' incidentally) so it's good practice generally when glueing to take steps to prevent squeeze-out being left on the surface of the wood.
The main ways people do this include wiping up the glue while it's still liquid, removing the glue when it has partially hardened to a sort of rubbery consistency, waiting for it to fully harden before scraping and/or sanding it off and last but not least taping surfaces to prevent glue getting on them in the first place.
This previous Q&A has more information on this, Glue spots under stain.
What are my options for fixing this? The several of the "unstained" spots are in very visible areas.
Very thorough sanding or scraping are nearly your only options here, although you could also switch to using 'gel stain' which despite its name is not actually a stain in the conventional sense as it sits on the surface of the wood and doesn't colour it by soaking in.
How deep do I need to sand to make sure the glue is gone?
Deep enough is the only guide here.
Glue penetration varies with species and cut of wood, the glue type and how liquid it is, temperature and humidity and perhaps other factors too but even if by some means you could find out the exact level of penetration, e.g. X thousandths of an inch, this wouldn't be of help anyway as there's no way to sand or scrape off exactly that much wood.
So you sand or scrape until testing reveals you've done enough, that's pretty much it.