Can I install Xcode on OS X 10.9.5?
The version currently available on the App Store (6.4) requires Yosemite or later, but if you're a registered developer, you can log in at developer.apple.com/downloads/, where all current and older downloads are posted. I'm not sure exactly how far back you'll need to go in order to find a version that runs on 10.9.5, but everything is there.
However, older Xcode versions will not have the newer SDKs, so you'll be stuck in the past. If you're serious about development, you really should keep your Mac up to date so you can use the current versions of everything.