If your friend has created a lobby to play together, you must join the game with the code. You have to press the "Online" button in the first place, like the first thing you do while setting up the lobby. Then you need to find the place where you will enter the lobby code from three different categories that appear on the screen. If you need more details, you can follow the steps below.
1) Press the "Online" button.
2) Enter the lobby code from the "Private" category in the blank field.
3) Join the lobby by clicking the right-facing arrow.