I think you know pretty well what flirting is about and what not. And he does as well. Put your foot down and ask for clear discussions and a set of rules/guide lines/boundaries that are from his point of view unambiguous as well. I would call bullshit on this one if he claims that he didn't know what he was doing there or that he didn't know what those set of boundaries you agreed on would mean from your point of view.
Sorry that things are so rough right now for you.
Facts: 30, female, bi, v-type relationship with Sward (husband, straight, mono) and Lin (boyfriend, straight, mono), poly-fi and co-primary.