Ted is a single, 27-year-old architect living with his two best friends from his college years; Marshall Eriksen, a law student, and Lily Aldrin, a kindergarten teacher and aspiring artist. Lily and Marshall have been dating for almost nine years when Marshall finally proposes.
Their engagement causes Ted to think about marriage and finding his soul mate, much to the disgust of his self-appointed best friend Barney Stinson, whom he met in the restroom at a bar four years earlier. Barney is a serial womanizer who concocts elaborate con games, usually involving costumes and fake identities, designed to bed women, only to lose interest in them immediately afterward.
Ted begins his search for his perfect soul mate and meets an ambitious young reporter from Canada, Robin Scherbatsky, with whom he quickly falls in love. He's sure it's love at first sight, but destiny may have something else in store.
The series is narrated through flashbacks from the future.