How to create complex and distinct characters

Hi everyone,

I have been making up stories in my head ever since I can remember. Sometimes, I write them down and I do think I have a few that turned out well. However, I am never able to write anything longer than a fairy tale or a truly short short-story. I think the main issue is that I have lots of ideas for things that could happen but I find it difficult to build characters who feel real and distincs from eachother. And to some extent you can get away with that in shorter forms, but the more I write and try to flesh out the characters, the more similar they become.

I am also trying not to base them on real-life friends but find it difficult. Eventually my character does something that "X" in my real life would do and once the association is there, I find it very hard to break away from it.

Any ideas on how to improve on this aspect of my writing?