Ok. Firstly connect to the internet on your 3DS. Then go to "friends" and add a new friend. My FC is: 1778-9743-3324 and IGN: May.
Once that is done. You go into your Pokemon game and go to the "PSS". connect to the internet there and you should see me on your friends list.
Once you connect and you added me on your 3DS before entering the game I will see you online too