We flashback to where it begins in 2005 with Ted Mosby ( Josh Radnor ) as a single, 27-year-old architect living with his two best friends from Wesleyan University , Marshall Eriksen ( Jason Segel ), a law student, and Lily Aldrin ( Alyson Hannigan ), a kindergarten teacher, who have been dating for almost nine years when Marshall proposes.