I've heard that it is automatically put in the front of your team for the N battle, but what if you have a full party? does one of your Pokemon get booted to the PC? what determines which one it is?
After the Legendary Pokémon is caught, the player has the option to add it to their party. This capture is forced, unless the player's party and PC Boxes are all full, in which case, the Legendary Pokémon will respawn at Dragonspiral Tower during the post-game.
If you catch Reshiram or Zekrom, and your party is full, you have to option to send one of your party member to the PC in exchange for it.
Source