Once you've replaced the SATA cable, as Dan suggests, then reinstall the SSD, attach the old HD through your Thunderbolt case, and format the SSD through the internal connection. Once that's done you should be able to install a new OS on the internal SSD.
The problem you're describing (SSD formats externally, but doesn't mount on the internal SATA bus) is a common problem with Mac laptops from about 2008-2011. Damaged SATA cables are often part of the problem; if you replace it with a brand new cable (not just a newer used cable), that often resolves the problem. Samsung SSDs such as the 850 have a reputation for being more fiddly on Macs than other SSDs such as OWC or Crucial/Micron. But typically, 2012 and later MacBook Pros will usually work with any SSD, as long as the SATA cable works properly and the drive is correctly formatted.
What operating system are you using? For a newer drive like this, later is better. I think the oldest OS you should be using is probably Mavericks/10.9.5.