First start by adding the external link to your WordPress navigation menu just like you would add any custom link.
Simply visit Appearance » Menus and click on the link tab. Enter the URL and link text and then click on add to menu button.
The external link you added will now appear in the Menu Structure column. You need to click on the downward arrow to expand the menu item. Like this:
Next, click on the Screen Options button at the top right corner of the screen and check the boxes next to Link Relationship (XFN) and Link Target options.
Now scroll back down to your expanded menu item, and you will notice two new options. Link Relationship and Open link in a new window/tab. You need to enter nofollow in the link relationship option. You can also check the open link in new window/tab option if you want.
Lastly, click on the Save Menu button to store your changes.
That’s all, you can now preview your site.
To make sure that a nofollow attribute is added to your link, you can take the mouse to the external link, right click and select inspect element. Your browser window will split into two. In the bottom window you will be able to see the HTML source for your link. It will display the nofollow attribute with your link.