He got it like all the others when he was released. July 1973 McCain was made full rank Commander 0-5 typical promotion expected in service which is what others got.
POW I knew was captured as a full Commander and promoted to Captain upon release. That man had more Time In Service than McCain and about 5 years later was promoted to Read Admiral.
Bud Day and Jeremiah Denton made 06 in captivity. So did Colonel Ted Guy. Even as POW you have to be recommended by the SRO. Colonel Ted Guy was McCain’s SRO. He wanted to bring McCain and few others up on charges upon their release. I don’t think promotion for McCain was in the cards as a POW. McCain went 6 and half years between promotion to 04 and 05. No promotions in captivity.
https://en.wikisource.org/wiki/Navy_biographical_data_released_for_John_McCain