The Mac can only support two monitors via a legacy input (HDMI and DVI).
Additional monitors require use of an ACTIVE mini displayport>DVI or HDMI adapter. Those are more expensive than the run-of-the-mill PASSIVE mini displayport>DVI or HDMI adapter.
For DVI input for resolutions greater than 1920x1200 you need a dual-link adapter that cost about $99.
However, that does not explain why you can't get two monitors to work now. Maybe a bad cable or adopter.
Try:
- Try resetting the SMC and NVRAM/PRAM
Intel-based Macs: Resetting the System Management Controller (SMC)
https://support.apple.com/en-us/HT201295
About NVRAM and PRAM
https://support.apple.com/en-us/HT204063
- Try starting in Safe Mode
OS X: What is Safe Boot, Safe Mode?
https://support.apple.com/en-us/HT201262
- Boot to Recovery and repair the startup disk
OS X: About OS X Recovery - Apple Support
https://support.apple.com/en-us/HT201314
- If it is repairable reinstall the OSX
How to reinstall OS X on your Mac - Apple Support
https://support.apple.com/en-us/HT204904