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.
Can you give us the full serial number of your system or better yet see if you can correctly identify which model series your system is using EveryMac then tell us what you have.
Sadly there are a few different versions of the 13" MacBook which is why we need to know what you have.
by Dan
Your systems specs: MacBook Pro 13" 2.5 GHz i5" (Mid-2012)
by Dan
@lola - Here's how to post things: Technique: Adding images to an existing question
by Dan