Stiles went missing during the wild hunt but instead of going to the train station, he went to a different universe. He goes to an earth where the world was scorched by the sun which created a deadly virus called the flare. There, he was taken by a government agency called The World In Catastrophe: Kill-zone Experiment Department or WCKD. They expeiremented on the kids of the next generation to find a cure for the flare. While Stiles was on the other earth, the pack was on Stiles' home earth trying to bring back everyone that was taken by the wild hunt, including Stiles.
The pack eventually brings everyone from the wild hunt back but it took them even longer to bring back Stiles because he wasn't in the wild hunt. When Stiles finally gets brought back to his earth and to Beacon Hills, he becomes depressed from not being with his friends from the maze and scorch.
One day, months after being back from the other universe; Stiles, the pack/friends/family from Beacon Hills, and the people from the maze/scorch; get transported to a theater in limbo where time doesn't pass. There, they meet the keeper of time who shows them what Stiles/Thomas life was like in both universes.