When drawing the tiles of your map, you start with the tile furthest away and work your way towards the “camera”. You then also draw everything on that tile when drawing the tile itself (i.e. characters, walls, furniture…), so that a character on a tile will be drawn before the wall on the tile in front of it. It’s all really just a matter of drawing everything in the right order. Something “behind” something else should always be drawn before the thing it’s behind. You just have to keep track of which character is on which tile. For each of my tiles, I have a CharacterHere variable that keeps track of that, so when I draw the tile, I just check the CharacterHere variable and draw the relevant character (if any). (I also keep track of which characters are moving into a tile, but that gets a bit more complicated.)