I have been an on and off watcher of the show but the finale was one for the ages, up there with last Cosby Show, MASH, and Newhart.
The last and 9th season was about Robin and Barney's wedding and on the very last episode of that season last night which starts in the present, the years in the future are ticking by every few minutes to lead up to the first season pilot taking place in the year 2030 and we learn the first shocker of the finale which is they get divorced a few years from now. They only have a three year marriage. This youtube reaction I found sums it all up around 7:15-8:15.
There are other shockers too like Barney having a daughter which gives him perspective on everything (and making us feel he gained a little girl even though he lost Robin) and Ted's wife dying (which we knew from season one) leaving him with the two grown kids he talks to in the first season pilot as a widower with two kids sitting down to tell his story of how he met their mother.
In the very final scene, after the blessing from the kids who don't have a mom but love "aunt" Robin, Ted brings the blue French horn he stole from Robin in the first season back to her apartment and we assume they strike up their romantic relationship again.
The two kids realize that the long story he told them is not really about their mother but about Robin.
That's how I saw it and I hope I got all the names and facts basically correct. Like many episodes in this iconic series, there's a lot left up to interpretation.