@MoJoe
Usually when I'm building a team I'll look at some Pokemon that I like at that moment, and think of unorthodox or uncommon sets that have good potential to work in whatever the metagame is looking at, at the time. Then I try and find one or two Pokemon who form a good combo with that Pokemon. These other Pokemon can usually eliminate counters (eg DragMag) or simply help my getting rid of entry hazards, setting them up or simply having good synergy. Then I see if I have any gaping holes to certain common Pokemon and patch those up with a slot or two. Finally I look at my team and see if I'm missing any crucial roles. For example, I might miss someone to set up Stealth Rock, a reliable revenge killer (eg. Scarf Terrakion or Band Scizor) or I might have a team that's really weak to entry hazards, so I need a spinner. Then I take it out for a test drive and fix things (add/remove team mates and change movesets/natures/items) as I go along. Eventually the teams work out!
That might have sounded a bit formulaic, buts that's usually how I go about it. I will say, though, that sometimes I get what I think are strokes of genius and just build a team in 15 minutes on a hunch, but those are far and few between.