Guys typically don’t have girls that are “just friends”. He probably liked you at some point but wanted to have you readily available to him so he labeled you guys as “good friends”, but didn’t wanna actually commit to you. When he left he probably found someone else to call a “good friend” and when that fizzled out or when he got tired of that friend, he came back