Is there such thing as a love square????

So me and my bf have a friend who has a gf that I’m friends with and I have got really close to that friend (let’s call him sam), so sams gf is my friend in color guard so Sam goes to our competitions and we’ve been hanging out a lot because of that and because my bf can’t go. So during sams gfs performance we hang out cause I’m like the only other person he knows on the team but yesterday at our competition he was laughing and joking around with me like a lot like he was flirting and stuff and he would like wink at me a little bit and idk what to do because we’re both in really good relationships and I might just be over reacting. But the thing is that I used to like Sam and once he told me he loved me (as a friend) and he’s hugged me and told me my eyes were pretty before we started dating people. Also yesterday I said something stupid so he play hit me on my boob and that’s not the first time he’s touched my boobs (long story but it wasn’t a flirty thing) so I’m honestly really confused and don’t know what’s going on please help...

Just remembered that Sam asked me to got to prom with him since he’s a junior and so is his girlfriend so he has an invitation that’s also important information.