I have been living in Illinois since 2012 on my F1 visa. From 2013 to present I have not left the country (I still lived in Illinois). I got married 2 years ago, and my spouse ( U.S. citizen and Illinois residence) is petitioning for me. I would like to know if I can get Illinois residency after receiving my green card. Thanks
I have been living in Illinois since 2012
You are already an Illinois resident, probably for every purpose.
Once you get your green card, you can establish yourself in any US state, the District of Columbia, and a few other places besides. There's no formal process of becoming a state resident. You just move there.
For some purposes, such as taxation or state university tuition, your student visa status might give you an exception. In that case, you'll need to look at whether the exception ends immediately when your status changes or after some period of time. For example, if you move to a new state, it might be one year before you qualify for in-state tuition rates.
In a comment, you write that you're asking about Illinois state tuition rates. The university of Illinois has a page on the topic. It says:
What if I’m an international student who has applied for permanent resident status in the United States?
As long as you hold a temporary visa, you don’t qualify for in-state tuition. However, when you receive federal notification that your status for permanent residency has been approved, you may start the period of establishment of residency for in-state tuition.
On the same page, you can learn that the period for establishing residency is one year.