This question already has an answer here:
Did Tolkien ever describe in any detail, other than Gandalf's own words, what happened to him in the brief period when he was "dead"?
For that matter, can we truly say that Gandalf did in fact die? It is my understanding that Gandalf was a Maia. In Tolkien's universe, are Maiar capable of dying? Would he have gone to the Halls of Mandos? Was Eru responsible for bringing him back? These are the sorts of questions I'm trying to answer, as my understanding of the event is vague and mysterious.