Let us assume (to avoid complications in scenario) that ex-wife agrees. My son has been out of US for many years. So, is his Green Card expired?
Regardless of the expiration date, his green card is not valid anymore because he's been gone for many years without an acceptable exception (e.g. reentry permits, parent in the US military, etc). However, there is a small chance of restoring his LPR status by having him apply for a Returning Resident Visa (SB-1) at the US consulate in India. Chances of approval are low because he's been away for so many years, but it's not impossible. The entire SB-1 process is normally less than 2 months, so you might want to give it a try if you can afford to lose the money and if your ex-wife is willing to transfer custody to you soon enough (if the SB-1 visa is approved he'll have to use it to enter the US by a particular date).
If he comes to stay with me before 18, how long does he needs to stay with me as LPR before he is eligible for derivative citizenship?
Theoretically one day, but in practice it means long enough to accumulate evidence that he's living with you in the US, which would mean more like 2-3 months. However, if you provide 2-3 months worth of evidence (e.g. school and medical records with his name and your address) when applying for his N-600 (citizenship certificate), they will normally backdate his citizenship to start at the starting date of your evidence (or possibly even the date of entry to the US, if the start date of your evidence is close enough to his LPR admission date).
So if he moved to the US as an LPR at 2 months before his 18th birthday, then immediately moved in with you and enrolled in a local school and then applied for the N-600 at 18 years 1 month old with 3 months of accumulated evidence of living with you, his citizenship certificate would show that he became a USC 2 months before his 18th birthday.
Of course, that doesn't mean it's a good idea to delay his entry until he's 17 years and 11 months old. If you cut it too close, some unexpected circumstance could delay his entry to the US or cause problems with establishing evidence of him living with you before he's 18.