If a guy texts you while he is with another girl?

So I behaved very childishly today I have to admit with this guy friend. He's been giving me several signs that he's interested in me but today he was talking to another girl in front of me like smiling and all with her and I don't know why I got very jealous seeing that even though he came to talk to me a couple of times in the middle of his conversation with her but I was so upset that I didn't reply. Immediately after that I left the place (very childish I know) but 10 min later I got a message from him asking what had happened and why I left. I don't know how to reply to that or what to say.

I'm kind of confused about my feelings for him now do I like him or was I just jealous seeing him give the attention to another girl that he usually only gives me? Also, does he care about me if he bothered to text me while he was still with the other girl?

Updates
+1 y
The next day after this we met in person and he looked hurt and asked me why I had left like that.
If a guy texts you while he is with another girl?
Post Opinion