I think you already know what I’m going to say: Your problem is not with this little girl. Your problem is with your so-called boyfriend. He is being a terrible father. A 2-year-old needs routine, security, and love. She needs to be fed regularly and well, put down for regular naps, and cuddled and loved as much as possible. Your boyfriend is guilty of neglect. If it were not for you, she would be malnourished and uncared for. Of course she whines. Of course she screams. She is communicating in the only way she can that the situation is intolerable for her.
You didn’t mention what goes on with the little girl’s mother. Even if you aren’t fond of each other, you two should be allies in caring for the little girl. Let the mom know what is going on. The needs of the child come first. Work together to make sure she gets the attention and care she wants and deserves.
You also didn’t mention how often and for how long you have the child in your care. If it is only a weekend now and then (and you insist on staying with this boy), you need to accept that you will be the parent as long as she is with you. Surely you can manage for a couple of days now and then if it means the health and welfare of a child. But if she is with you regularly, you have every right to insist that your boyfriend man up and be a dad. Actually, I don’t care if she is with you five minutes or five days. This little girl deserves a whole lot better than she is getting from her father.
I have to wonder: Why on earth are you staying with this guy? The way he treats his little daughter is the way he’ll treat any children you may have in the future. The way he is treating you is unlikely to change. I’m sure he can be sweet or you won’t be with him at all. But sweetness doesn’t let a man off from being responsible.
I wish you well.