Why did he ghost me and then come back?

We used to talk day and night and everything with him just seemed right I never even had to look for a topic when I was talking to him. But then he suddenly started pulling back and ghosted me for a while then he came back, talked to me for a day or so and then started ghosting again and this thing repeated thrice he just used to ghost and come back. But then when I met him after a long time, he acted like I was his girlfriend, as if I was the only girl he wanted. He flirts with me as well but when I said I liked him he didn't say a word. What does this even mean. I am kinda confused if he even has feelings for me.
Why did he ghost me and then come back?
Post Opinion