##Step 1
First of all, you need to set up a normal Minecraft server. A good guide on this can be found herehere.
For troubleshooting, please refer to an already existing thread: here.
In addtion to both @jofri and @RimaNari, you could also choose another way of setting up a server like Minecraft Realms.
##Step 2
Now, assuming that this was no problem for you we can go on and make sure only you and your friend can access this server.
- Make sure you are an OP and/or have access to the console.
- Run the command:
/whitelist on
- For each player you want to have access to the server run the command:
/whitelist add [playername]
- After all players are added, run the following command:
/whitelist reload
Now only players whom are white listed on your server will be able to connect!
Sources: