When you ask a guy out, and he's fine with it, THAT'S how you find out if he's confident. And confident, nice guys are generally a better bet in the relationship department.
A guy can be confident, but not sure about how you were reacting to his attention. You didn't indicate in your post that you gave him any positive flirts back or anything. So he's probably unsure how to proceed with you.
I have a long time interest in psychology, specializing in relationship dynamics for 30 years.
(Please note, we give the best advice we can based on the information given in a post. For better advice, please include the age of all romantic partners.)