im looking to unlock it using its imei and one of the websites that do that. but i want to know if i will be able to use it with a gsm network here in mexico or if i will have to use it with a cdma network
I have no idea if it will work in Mexico.
But I can tell you that there is no commercial unlock whereby you pay a third party and you get an unlock.
The SIM in a Sprint iPhone is paired with the device. It's possible to get it international unlocked, which is what you want, but as already mentioned that can be difficult, time consuming and not worth it.
But here's what you need to do if you want to go that route.
1. Establish service with Sprint. You cannot have an ASL account (i.e., bad credit).
2. Pay your bill on time for 90 days.
3. Call Sprint and ask for the international unlock.
Anything less means no unlock. Do not waste your time or money on anyone promising you that they can unlock the phone. They can't. Only Sprint can and they will only do the international part.
The only other option is a SIM Interposer, such as a Gevey or an R-SIM. Those devices trick the phone into thinking it's still on the original network by performing a MITM (Man In The Middle) attack on the SIM. But, they are not true unlocks and any time you update you'll need to buy a new interposer.