Who can claim my kids?

I live in Michigan and have 2 kids a 1 and 2 year old. Last taxes I claimed my kids because I had full custody. I remained having full custody until the end of September. So 10 months, their Dad only had custody 3 months out of 2017. I was stupid and signed a paper because I was in a rush to get to work. She told me that the paper would allow their father to take them to doctor appoiments without needing a note from me or calling which is easy for me when I'm at work. (His mom takes them in for the smallest things, ) Well I was talking to my grandmother and she told me that he's their Dad and they shouldn't need me to sign anything for them to take the kids in to the hospital. So I texted and asked her what the papers really were. She told me 50/50 custody, then I got my copy and it states that he has physical some custody and I have Tuesdays, Thursdays, and everything other weekend. So I'm not sure who can claim them this year. I was told because I had full custody most of the year that I can. I plan to go back to court and regain my rights. I'm a young mom so please don't judge