Sorry for resurrecting a week old thread...
Maverik's option is mostly likely though I think it can be nuanced. In this scenario another possibility for head of government would be general Armada, unless the infamous "White Elephant", the code name for the still unknown supreme leader of the coup, was actually a different person which we don't know, thought probably it was either Armada or Milans del Bosch. But if the
Brunete armored division takes Madrid streets and rebel troops seize the royal palace, a questions appears. The coup pretended to be a royalist coup with the bless of the king and in the name of the king. If their legitimating figure flees the country, they would have a hard time to justify themselves to their civilian supporters, not to mention to those other military high ranks which would join the coup in the last moment if it seems it's going to win*.
But we have the possibility where Juan Carlos is captured. Keep in mind that Armada was one of its closest friends since his teen years, thus it's not completly unlikely that he could convince Juan Carlos to accept the new punchist government (it's composition is a mistery, since we don't know all the names involved in the plot. It's said that Armada wanted to be some short of a spanish De Gaulle and was thinking about a national concentration government. But people like Milans del Bosch and other purely facist member in the military top levels (we are talking about a veteran of the blue division) including Tejero had different ideas. Also, I doubt that any democratic party would want to cooperate with this new government, however some individual figures from those parties could do it. In short, the others in the plot, or at least those who were visible, don't like Armada's plans, but Armada is the most direct key to "convince" the king.
But I disgress. We can have Maverick's scenario but with Juan Carlos as puppet king of the military instead of exiled. The regime is probably also doomed in the short term, as Maverick suggests, due to the lack of popular and international support. Even the spanish economical elites had decided at the time that it was more useful for their interests joining the civilised world and its economical opportunities than the tireless figting against the judeo-masonic-marxist cabala. After the collapse of Armada's government, probably with a very nasty social unrest in several parts of the country, the figure of the monarchy, which still was far from being completly accepted at the time (it was the precissely the king's attitude during the coup attempt which galvanized its legitimacy) would return at least to 1931 levels of popularity and we have our third spanish republic in 1982 or 1983. However, if he is in the exile, I think he would have slighty more options to retake the throne after the collapse of the military government, depending obviously in the circumstances of his fleeing. Anyway, there is a misterious physical phenomenon which causes that an spanish Bourbon's ass and its throne generate a strong mutual attraction force under almost any circumstance.
*Sorry, I'm unable to translate it, but an someone once described the attitude of some military leaders that day as "
¿quiénes vamos ganando?" If someone can translate it keeping its sense it would be nice
Another scenario is butterflying Adolfo Suárez from the government in the early years of the transition to democracy. If some other person, less able and/or with less cojones to go ahead with the reforms towards democracy, the opposition to Juan Carlos and its association with Franco in people's mindset could be stronger. Specially, if the Communist Party is not legalized, it can have further consequences. Helios Ra asks about the communists importance in post civil-war Spain. Well, the CP was the opposition force with more afiliation in francoist Spain. But actually, many of its members were not communists. Simply, they had an efficient infrastructure to fight against the regime from inside and from outside the country, an infrastructure and capability that other opposition forces laked. So, many people who opposed Franco but wasn't communist joined the party and other side organizations like the union
Comisiones Obreras in order to fight the dictatorship, specially in the 60's and 70's. Given their affiliation numbers, they expected a big result in the first elections. They get very disappointed when they realized that, despite having a decent representation in the parliament, most of spanish left voted the Socialist Party instead of them. "It's too soon, there is still fear to a military reaction, next time it will be better" they said then. In the next elections they did still worse. But anyway, if those thousands of spaniards stay in the clandestinity, regardless if they are properly communists or not, or the organization which hosted them during the dark years is still prosecuted, I foresee a lot of distrust towards Juan Carlos in large sectors of the spanish society, eventually leading to its fall.
Another scenario, while more unlikely, or at least more random. NATO debate and political strife about NATO goes mad. UCD governments (1978-1982) pushed spanish integration into the NATO and it's not a secret that the king supported it. The Socialist Party was against it. But for everyone's surprise, they changed their view after they reached the government in 1982. In 1986 a referendum asking for the spanish permanency in the NATO, as promised in 1982 campaing, was held. But the difference this time was that the socialist government was promoting the "Yes"

, not to mention that the question in the ballots was longer than the Treaty of Brussels itself. The "Yes" won, with a lot of socialist voters with their hearts divided between loyalty to the party and their opposition to NATO. I assume that Felipe González's change of mind after 1982 has its roots in meetings with other international leaders, but it's only a guess. So, let's say that Felipe González and the PSOE keep their position regarding the NATO. There is a possibility where the king could try to press the government in favour of NATO permanency (if he didn't it in OTL) and it could eventually trigger a conflict between Felipe G. and Juancar meaning that OTL honeymoon between the king and the PSOE doesn't happen. With an hostile PSOE and the lack of "kindness" granted by PSOE friendly multimedia group PRISA which became the biggest mediatic spanish group by the late 80's Monarchy could have a harder time than in OTL (PRISA owned at the time, among other things, the most read spanish newspaper,
El Paìs, and the most listened radio station,
SER. Note that in Spain, compared to other countries, radio stations are still a main player, as important or more than TV, regarding political opinion, information and news due to several endemic factors that are irrelevant here) Specially if Felipe G., a very charismatic guy during its early years, decides to play the wild card, considering he had a lot of mediatic artillery, PRISA plus state sponsored media like TVE, to destroy the image of the king.
And finally, even more unlikely, if ETA manages to kill the king in the early 80's there is a possibility for a third republic, since there was not a true alternative to Juan Carlos. However, in this case everything could happen after the initial chaos caused by a so hard coup inflicted to the state by ETA.
Cheers.