In one timeline, after being "betrayed" by Clara Oswald, the Twelfth Doctor wandered the universe in search of Gallifrey, but instead found solace with the Voord, and then began a campaign to ensure his fallout with Clara.
Biography
Original timeline
After Clara Oswald acted against him, the Doctor told her to "go to hell" and the two parted company, with the Doctor feeling betrayed by her actions. He tried to find Gallifrey, but was unable to, leaving him to wallow in despair within his TARDIS as a paranoid recluse. Eventually, he found his way to Marinus in a pocket dimension, and joined with the Voord in order to find peace, becoming the new leader of the Voord. Having found happiness, the Doctor soon began remembering the events that had led to his falling out with Clara, such as lingering memory of meeting an alternate version of himself leading the Voord. Realising the paradox he was in, the Doctor began preparing to bring about the "Multi-Doctor Event" that would ensure his existence.
When his past incarnations and younger self became trapped in the continuity bomb, the Doctor made sure they were forced to pick his future by making it seem the least dangerous. The Doctor was surprised to see Clara again, but recognised everyone else and agreed to give them a lift to a small pocket universe inhabited by the Voord. Upon arriving, the Voord offered the Doctor a capsule, and he revealed that he was the leader of the Voord.
After the Doctor revealed how he found companionship and healing in the Voord city, and had arranged the meeting of the Doctors to ensure his timeline would be whole, he announced his intent to erase Gabby Gonzalez, Alice Obiefune and their Doctors' memories of the event, but implant mental commands in the Twelfth Doctor and Clara's minds to ensure they would fall out in the betrayal, allowing the Doctor to become his alternate self and lead the Voord on a universal conquest. As they were being led to have their memories altered, the Doctors staged a distraction, allowing Gabby and Alice to escape. The Doctors and Clara were then taken to the Conscience, where the alternative Twelfth Doctor altered their memories, and sent them back to their own universe to live out their new destinies.
As the Doctor gloated about his victory, Alice was killed by his Voord guards and Gabby was sent back down her own personal timeline by a Weeping Angel hidden in the Eleventh Doctor's comics package. Arriving at the café before the three Doctors appeared, Gabby warned the companions of what would occur if things went the way they had before, before fading from existence. (COMIC: Four Doctors)
A new timeline
Now prepared for his alternate counterpart's deceptions, the Twelfth Doctor led his past incarnations and their companions to Marinus to deliberately set off the continuity bomb and enter the Voord city through River Song's World. Once there, the Twelfth Doctor entered the Voord group mind, and was confronted by the alternate Doctor. The alternate Doctor was able to overpower his younger self, until the Twelfth Doctor called in the other Doctors to assist him. Learning that the Doctors had sabotaged the city's force field, the alternate Doctor was left with the choice of letting the Voord be destroyed or to use the Dalek weapon to regress their timeline, even though it meant erasing himself from existence. After Clara apologised to him, the alternate Doctor regressed the Voord's timeline, but did request for Clara to not forget him. (COMIC: Four Doctors)