To add your old 16 digit code:
From this forum, click your profile name on the upper right, Account settings. Enter the 16 digit code in the “Redeem a code” field.
To get the 26 digit code, go to Games and Subscriptions (left side), scroll down under “Classic Games”, you should see a 26 alphanumeric code to the right of “Diablo II” and another if you also added Lord of Destruction. These are the keys you need to copy and paste into each installer.
I’m just going to go ahead and throw out a warning about VPN usage since a lot of people trying to play Diablo 2 get hammered with a temp ban because of them. If you do use a VPN, make absolutely sure that it’s turned off before attempting to play on Battle.net. Also some business class ISP’s can get you restricted.