All I can answer with is how it used to work in v3.5. Since I haven't seen anything that alters how it used to work, the assumption is that it still works the same. The only statement I've found in the core rulebook is on page 202
"For simplicity, assume that you share your mount’s space during combat."
The rider is in whatever square he needs to be in, and can be targeted in any of the squares. IIRC, there was a note in v3.5 somewhere about changing that by DM fiat when the size difference between rider and mount got too great, but "too great" was not defined.
I'm in a location that restricts where I can web-search and I don't have my old 3.5 books here (they're safe in a closet at home), so I'm afraid I can't give you actual rules quotes.
EDIT: Turns out I have a local copy of the old "All About Mounts" web-article, so I can share a quote from that. Remember this is v3.5 material, so the page references are to v3.5 books
l A mount and rider share the same space on the battlefield.For all game purposes, you and your mount function as a single unit on the battlefield. Your mount continues to use its own space and reach while carrying you. You effectively use your mount's space and
your own reach (or whatever extended reach your weapon gives you) while mounted. While you're mounted, any attack that can reach a square in the space you and your mount jointly occupy can affect
you or your mount (it doesn't make a difference which square). Likewise, you measure your reach for your melee attacks and the range for your ranged attacks from any square you and your mount jointly occupy. You don't get cover from your mount unless you use the Ride skill to get it, and your mount doesn't block your attacks and provide your foes with cover.
Normally, you and an ally cannot share the same space on the battlefield unless one of you is helpless or a lot bigger than the other (see page 148 in the Player's Handbook and page 29 in the Dungeon Master's Guide).