Hm, there might be several problems.
If you are an alien married to another alien who is a legal permanent resident (green card holder) you can apply for that same status, but you have to wait until a visa number is available. Currently there is a backlog in applications which lasts about 5 years, in other words, it will take at least five years until that adjustment of status can be worked on.
Now, there is a bigger problem. Spouses of US citizens are allowed to wait in the country until their cases are adjudicated (it usually takes about a year there). Spouses of LPRs are NOT allowed to wait in the country unless they have a valid legal visa for other reasons. And once you are out of any legal status you never can "adjust" to a legal status. Example:
Susi is German and married Peter, who is also German but lives with a green card in the US. Susi entered the country as a tourist and was allowed to stay 6 months.
Now she actually stayed 2 years and now wants to "adjust" her status to legal permanent resident. That is not possible, because there is no status to "adjust". Once the 6 months were over, she had no legal status at all, she was in fact an illegal alien. Illegal aliens cannot adjust to a legal status while in the country. Despite being married to Peter Susi would have had to leave the country after the initial 6 months and wait outside the country until a visa number became available and her status would have been approved.
If you are facing one of these problems and are in the US now, you should consult an immigration attorney. Being in the country out of status (illegally) can lead to worse problems in the future.