One of mine did this for a while. I have noticed people always comment when the child prefers the father, but if as the mother you are preferred they just ignore it. 
I discussed with the child how I wanted to spend a bit of time with them, and we had DC and mummy time. I think mine was a little older than two though.
I would plan a treat or trip to park together and just go for it, accepting they might yell their head off, but you can pass it off in public as toddler behaviour. If you can face it (and it's probably worth steeling yourself up for it) plan one every week/ few weeks.
I think parent preference is a delightful toddler phase, and if they can get anywhere with it they will keep it up.
To the go home comment I would calmly tell them I am in charge, not you, and I'm staying.
(I was not so mature when this happened to me.)
To MIL, practice a line like This is such a fun phase in his development, or Clearly he knows he' secure enough with my love to try it on like this.
DC and I have a great relationship now.