Once you get your Friend code you have to give it to the person your battling and they will add it to there pal pad then you get there friend code and you add theirs.
Then you go downstairs once again and you talk to one of the ladies to the left and connect to wifi.
Then when your both on one of you host a Free Battle, Lv 50 battle or Lv 100 battle.
The level 50 and level 100 battles SET your pokemon to these levels which is why lvl 100 battle is commonly used for online battling.
Then you join him game and the battle starts.
Good luck and happy battling. ^_~