Here's how Apple says you can upgrade via their macOS upgrade page. You need to install an intermediate upgrade first.
Upgrading from OS X Snow Leopard
If you’re running Snow Leopard (10.6.8) and your Mac supports macOS Sierra, you will need to upgrade to El Capitan from the App Store first. Then you can update to Sierra.
Upgrading from OS X Leopard
If you’re running Leopard and would like to upgrade to macOS Sierra, first you’ll need to upgrade to OS X Snow Leopard. You can purchase OS X Snow Leopard from the Apple Online Store. Then upgrade to El Capitan as above, and then to Sierra.