The quick answer to your question is: There is no evidence that he did.
There have been some pretty good answers on the subject which crops up from time to time, but both from the perspective of the Spanish and from the native accounts by way of Alvarado Tezozomoc in "Chronicle of Mexico", Cortez himself also never mentions anything of the sort in his letters, neither does his chronicler Lopez de Gomara, the only real source for this is a few paragraphs by Bernal del Castillo in "True History of the Conquest of New Spain", but he is writing decades after the fact (and for starters the presence and even the real identity of Bernal del Castillo is slightly questionable as well), there is just very littlehardevidence that would led us to believe Moctezuma Xocoyotzin would've considered any of the Spanish as gods.
There's a very complete answer in the FAQ by /u/ucumu , which I recommend you give a read to: https://www.reddit.com/r/AskHistorians/comments/345ziu/did_moctezuma_ii_really_believe_cortes_was_an/cqrmxmw/