What distro do I need to download for version

I have version and I need to reinstall, how can I tell what distro I need to download?

For FreePBX 12 you are looking for Distro version 6.12.65

This version is end of life, so you really want to upgrade to current when you can:

Can I do an in place upgrade to the latest version or can I install the latest version and restore from a backup of my current PBX?

You can only restore backups between like versions of FreePBX, a 12->13 restore WILL fail. With any modern version of the FreePBX distro you can upgrade in place using the scripts linked above.