Does He Not Like Me Anymore? What Happened?

I met this guy at work, Sam. He came up to me with his friends and family. We joked and flirted and he gave me is number.

We texted all night and he invited me rafting. I went, it was him and his friend. We all talked and joked and midday he asked me to put sunscreen on his back and then said I needed some too and put it on me. His friend said 'he's been waiting for that all day'. Sam hugged me bye and I hugged his friend too to be nice. They said they would text me to hang later

BUT I get a text from his friend (Matt), and HE keeps texting me the plans. I found it weird but I went anyway. I get there and they're with some girl, their high school friend, real nice and pretty. At the table the seat they left me was next to Sam and a pole (so I couldn't see Matt well).

But Sam kept talking to the girl and kinda flirting. He'd talk to me too but so would Matt (n Matt rarely talked to the girl). Sam did bring up rafting and the sunscreen thing in front of the girl. But everything seemed so wrong so I was staying quiet. Sam asked if I was tired, I said yeah.

I ran into a friend so I left to say hi. I was gone 10 minutes, to avoid Matt and try to make Sam jealous. When I came back Sam talked to me more, but it died down. Then he said they were going home, and I said I'd stay. Sam hugged me and said 'thanks for showing us around today'. 15 min later I leave and on my way out I see their car, so they never actually left.

So what happened? I thought Sam liked me? Didn't it seem good in the beginning? What did I do?