What's going on in his mind?

Long story short, known a guy for 4 years - told him how I felt, he told me that he wasn't interested and he instantly went from open, friendly, affectionate and flirtatious to closed off, avoids eye contact and all communication, sulky and just not nice.
I back off because tbh who wants a guy like that? In the months that I have kept away he started trying to be friendly and smiling at me again, he visits my website everyday (almost without fail) several times a day and he has even downloaded some of my photos onto his Iphone.

I think he just backed off for awhile to let you know in a weird guy sense that he isn't interested, but him coming back around means he enjoys having your friendship in his life.

Not a chance! Maybe when he grows up a little. Right now, that weird guy doesn't care about getting to know you but probably is more interested getting into you pants.