Those who I have created with a (successful) roleplay in mind resulting in a stronger personality and more unique type of gameplay OR those who develop one during the gameplay (bonus points if they somehow manage to surprise me).
Some examples:
My favorite Sim from TS2 was Gordon who actually started as a "test subject", someone who tried out all kinds of stupid stuff I didn't dare to do with other "more important" sims. In the end, due to so much happening to him, I grew really attached and he ceased being a disposable test subject and became my favorite.
My favorite TS4 sim is Axel because he's a combination of established roleplay (I had a pretty clear vision of what type of sim I wanted to create) AND development during the gameplay. There were some things I was planning for him but then he managed to mess it all up and I just rolled with it, my roleplay changing accordingly. He's my first TS4 sim so some things changed just because of my lack of knowledge (e.g. accidental romantic relationships) but I find that kind of stuff really memorable and funny. There have also been some lucky shenanigans. Like him trying to do his evil vampire routine by inviting himself in to feed on the residents but then also ending up saving them because at that moment they failed at cooking. Happened twice actually. His stan also ended up being a townie he actually saved from death earlier, that makes so much sense that I can't help but love it.
I also have a heavy tendency to get attached to sims who are flawed and able to cause some drama. All my favorites have some sort of negative aspect to their character. They might have a trait like evil or mean or their gameplay has some shenanigans in it. For example: I have a household of siblings, triplet boys and their older sister, and I currently find Blaze the least memorable. Keira is gloomy and has emotional control issues so she throws random tantrums. Abel is a troublemaker (mean, hot-headed) and has way too much fun with criminal career. River's traits might be all good BUT he's doing the serial romantic aspiration and has had no forethought about the heartbreak he might cause. Blaze instead is kind of just... "normal" friendly guy which makes him less memorable for me. That might change in the future depending on how his gameplay goes but for now, unlike with his siblings, I haven't truly developed a roleplay/characterization for him. With the others it somehow came more naturally because their personalities came off stronger.