My spouse entered legally and overstayed.
In general, if your spouse entered the US legally and overstayed the authorized stay, you can petition for your spouse to become a permanent resident. All the usual requirements to become a permanent resident must be met, including showing good moral character, completing a medical exam, providing an Affidavit of Support, etc. (see blog posts and website links below).
My spouse crossed the border without inspection
If your spouse entered the US without inspection, he will have a harder time getting permanent residence. He cannot complete the process in the US because he is ineligible for Adjustment of Status. He needs to apply at a consulate in his home country. Your spouse will need to request a waiver of inadmissibility on Form I-601. He needs to show that it would cause "extreme hardship" to you if he was not allowed back to the US. "Extreme hardship" is a very high standard - it needs to be greater than the normal hardship that a person would endure if they were separated from their spouse involuntarily. This includes showing why you could not move to his country to live with your spouse.
Can everyone get a waiver?
If your spouse entered without inspection over one year ago, OR was ordered removed from the US AND attempted to enter again without inspection, there is no waiver until he has been outside the US for 10 years.
Where do I start?
If you are a US citizen married to an undocumented immigrant, please contact an immigration lawyer about your case. Do not attempt to file the paperwork yourself, especially if your spouse entered without inspection (EWI), because there are many facts to analyze. The date that your spouse entered, any prior immigration paperwork that was filed for him, his criminal history, and many other factors are important. Also note that the waiver process can take months or even years before you get a decision.