Use this when you're counting or comparing things (like when you're competing with a friend), and one of the items doesn't fit the category.
A: I've worked in the film industry too.
B: You mean that job you had at the production company? That doesn't count - you only worked there for three months!
You can also say that something doesn't fit into a category with the phrase "___ doesn't count as ___":
Golf doesn't count as a sport. It's too slow.