Hard facts are lacking about the short and hectic life and career of Olav Tryggvason. A debatable point is whether he really was a descendant of the Yngling family and Harald Fairhair. But this was Olav's strongest source of legitimacy when he returned to Norway to break the opponents of Christianity and assert his right to the throne of Norway.
Sagas and myths relate that Olav was born on an islet in Lake Randsfjorden. At that time his father Trygve (who allegedly was the grandson of Harald Fairhair) had already been killed in a battle between local chieftains. This was also how life was to be for Olav: From one battle to the next, blow by blow.
Olav spent his childhood and formative years in the east, in Gardarike [Russia]. Here he saw practical action at any early stage in his life, going on Viking raids around the Baltic Sea. Later his radius was expanded south and west. There is relatively reliable evidence that he was in England in 991, and that he paid another visit there three years later.
In the spring of 995 Olav was converted to Christianity, and he then dedicated his life to combating the heathens and winning the throne of Norway. This eventually brought him to Trøndelag, the centre of power, where the population over time had lost patience with Håkon Jarl and his bullying style of rule. Olav was received as a liberator, and hailed as the King at Øreting [the court of Øre].
Then he founded what was to become the town of Trondheim, probably in 997, building a mansion on Nidarnes. In the years to come this was his headquarters, while he more or less gained total control over all of Norway, the first to do so since Harald Fairhair.
This was no idyllic period in the history of Norway, and Olav Tryggvason met his fate in the battle of Svolder in 1000. He never won a final victory for Christianity. But he had founded Trondheim, and that is a fact.