Chalk it up to experience, kiddo. It is better for him to realize he's not ready for a serious kind of relationship at this point. He's young, and the enxt three or four years are going to make a huge difference in his life and maturity level.

Take a deep breath, and make yourself wait a number of days before you text him again. The last thing you want to do right now is appear needy. You may be able to retain some of the friendship, but in a limited form, so you need to decide if you want to make that effort for a relationship that isn;t what you are looking for right now.