1. Start here:
https://developer.apple.com/support/xcode/
2. Find the words "Previous versions of Xcode" and click the link "downloaded here".
3. Log in using your Apple ID. It doesn't need to be a paid Developer ID, but it does need to be registered as a Developer ID.
4. You should end up here (requires dev login to see):
https://developer.apple.com/downloads/
5. Enter
xcode 4 into the text box that filters output. The list should filter down to about 15-20 items. Xcode 4 is the last version compatible with Lion. All versions of Xcode 5 and higher need Mtn Lion or later.
If you want even older versions of Xcode, try
xcode 3 or
xcode 2 as the filter.
I found the starting page linked at #1 by googling
older versions of xcode.