I personally think the key ingredient of complex characters is motivation, and it's not accident that when preparing for a role or a scene, that's the first thing an actor will prepare.
All people want something and are trying to get something, and what they're trying to get will change constantly. The best way to implement classic dramatic structure is to layer a character's objectives across the various parts of the story. There will be one over-arching objective, but also maybe different objectives for specific parts or volumes or chapters or sequences (depending on how you structure your story). There's also likely to be secondary objectives that relate to interactions with different characters.
Finally, in every single scene your characters will each have one thing they're trying to achieve at that moment. That will guide their behaviour in a given scene. What that is might have no relationship to their broader objectives whatsoever - indeed it may run directly counter to their broader objectives.
An example might be a character who's broader objective is to lose weight, but in a given scene they're miserable and their objective is to feel better so they eat some comfort food like ice cream.
Give your characters multiple competing objectives, and they will instantly become more complex.
Having complex objectives is also a great way to develop inter-personal and intra-personal conflict (two of the three key types of conflict that are at the heart of good drama). In the above scenario, the character may feel guilty about eating icre cream because they're meant to be losing weight, so they're actually going to feel WORSE and you've got some great internal conflict to play with. Alternatively, maybe their flatmate comes home and knows they're trying to lose weight and starts nagging them about it. Perhaps that's a common conflict the overweight lazy character constantly has with their fitter, more active friend (maybe it was their friend that put them up to losing weight in the first place and their super objective isn't actually to lose weight but to get their friend off their back!)
See how you can quickly go in complex and interesting directions just by nailing down objectives? The other thing is, if you have good character objectives, and you've determined basic character traits, these will naturally reveal your conflicts.
I have a character that's quite emotional and impulsive, and he's away from his home but he wants to get back there to join in a war. The person looking after him is calculating and careful, and wants him to remain safe, out of harm's way. That immediately informs the major point of conflict between them - he wants to leave, the other person wants him to stay - but also the nature of their conflict - he snaps out emotionally and impulsively, getting worked up, while the other person calmly lays out a logical argument.