The older you are when you get into a serious relationship, the more emotionally-mature you will be.
And it is this - not love - that makes a relationship work. That avoids heartbreak.
As for what happened over this guy .. you were attached to him. You wanted him. But LOVE doesn't even START to grow until you have been living with them as a partner for at least a couple of years .. and then it takes another 20 years or so before the love starts to blossom and work.
You had a fantasy about a guy you didn't know very well, and you thought that fantasy was reality, and you became very attached/invested in that fantasy. This is not love.
And the problem with heartbreak is that every time you get your heart broken, you build a stronger wall around your heart .. so you won't get hurt again. Unfortunately, this means you cannot open your heart TO love, so your relationships will be more likely to fail.
Turning 22 is fine.