I was very interested this season about how scenes are filmed. I guess I had never really thought much about it.
Apparently they tend to film in sequence of the script or they did anyway for HIMYM. In this case, Jason Segel had other filming to shoot so they filmed out of order. So, I guess Marshall will be in the last scenes but they were filmed a week earlier.
The last scene filmed seems to be Ted and the Mother meeting as Josh Radnor and Christin Milioti were the only ones that had not finished yet.
These are from David Baker’s twitter who is/was the Propmaster on the set.
It’s interesting that Cobie Smulders and Neil Patrick Harris showed up after being done with their parts just to see the scene be filmed.
Well and also apparently so Cobie could be the bartender for the after party :D
Cobie at the Late Show with David Letterman