Trying to reinstall macOS on a 2009 MacBook Pro
Solution 1:
Just to clarify the terminology used: If you ask about "reinstall macOS" that would mean macOS "Sierra", at least, strictly speaking, older versions of the Macintosh operating system are called Mac OS X.
This 2009 MacBook Pro should be able to boot anything from Leopard, Snow Leopard, Yosemite to Sierra. That translate into version numbers as anything from 10.5.7 (9J3050) to 10.11 (and with caveats: also 10.12) can be installed.
To install any version of OS X/macOS it is strictly speaking not necessary to provide or even have an AppleID. But you need access to an ***Install.app that is usually downloaded via the AppStore. Once that is downloaded or came otherwise into your possession in full then the app is transferable to other Macs.
For the actual install it is possible to create a real external install medium, most users opt for a USB-stick. An application that greatly simplifies the task is DiskMakerX.
Sierra is not officially supported on that machine you have now. It might also be a challenge to request that download from a machine that Apple is no longer supporting or if you want to use the AppStore and have not previously downloaded the installer with the AppleID currently in use. (And now that High Sierra s released a re-download of the Sierra installer seems impossible…)
That sign you see on screen when booting an installer with the official version of Sierra shows you that Apple has blacklisted this machine from receiving this upgrade. But Sierra can be installed and works for many more Macs than Apple allows. (Which would be self-evident if the terminology used in the OP's question is accurate.) See this Sierrapatch to help you with that. A 2009 MacBook Pro is listed there as a supported machine, in principle.
But be sure to verify your WiFi card is supported before you go that route. That might be the only real deal breaker for Sierra on this hardware. If it had Sierra previously installed and WiFi was working you are good to go with it.
"If I buy Snow Leopard[…]?" As stated above Snow Leopard should work. But there are now certain downsides to be considered for this approach. In terms of performance, security and support, whether from Apple or third party developers, Snow Leopard is not that good of a choice, especially if this machine is going to be used on the net. [Currently Yosemite would be the best pick as it has recently received at least some security updates.] Update: Since the release of High Sierra it has to be presumed that also Yosemite is now some kind of abandonware. A recommendation would therefore move up to 10.11 El Capitan.
Solution 2:
This is a tough scenario - you need to use an Apple ID that has previously downloaded Yosemite before. This ID is not tied to the machine afterwards in any way. The App Store removes old versions of OS X so it is normal to not find it there. You could build a bootable installer but you'd still have to find a copy of Yosemite which like I said is not in the App Store anymore unless you've previously downloaded it, in which case you'll find it in the 'Purchased' tab.
It's also worth noting that an Apple Store could likely do this for you, most of them have old bootable installer copies just for this purpose. Just call ahead to make sure. Purchasing Snow Leopard would work as well, the Snow Leopard disk would install Snow Leopard but be aware you still won't have an upgrade path to Yosemite from the App Store.