Welcome to the club. Most of us, non-EU folks, have the same issue. There is a LOT of good information here in the forum. Search for “PCR test at Santiago.”
Basically, you need to make an appointment to get a test on the SECOND DAY before you plan to travel. This gets you a test result good for 72-hours the next day, or THE DAY BEFORE YOU ACTUALLY travel home. Most of the labs deliver a result in 24–hours. But you have to be in Santiago to pick up the printed results that are acceptable to the airlines and border officials.
Many of the test sites have websites where you can make an appointment online. Also, many of these places have English speakers to facilitate matters.
I arrive in Santiago on 2 September for three weeks at the Pilgrim Office. My research on the forum provided me several places to make an appointment for a PCR test, in time for my return to the US.
The bottom line is that the days of arriving at Santiago in the morning, getting your Compostela and then attending the noon Pilgrim Mass, so you can depart for home in the afternoon are LONG GONE!
To do the PCR test, you need to spend two nights at Santiago, AND pre-schedule your test.
This is the new, pandemic-driven paradigm. We don’t need to like it. But we DO need to accept it, and just roll with it.
I hope this helps.
Tom