How often do you hear the comment that "S/he's just doing it for attention". What does that mean? That they shouldn't!!
All children want attention. ALL HUMANS WANT ATTENTION. Yes, even you.
It is natural to want attention and connection from another being. Babies need attention all the time they are awake, and then gradually the need lessens a bit. I suggest that the more attention children have when little, they less they "need" when older. I know - can seem a funny concept, because we are so used to thinking ahead and thinking we need to teach children ahead of time - like, they need to sit at school so teach them to sit beforehand, and they need to know how to write their name at school so teach them early. BUT this is back to front!!!! Provide more of what they really need at the stage they are at and then they will be ready for the next stage. Miss out stuff and issues will arise.
So, lots of attention when young. Get in first and consider what and how you can give attention in those situations where they may demand it in less appropriate ways. You know, visitors or when you want to talk to other adults. Include your young one, give them a role to play in helping settle visitors.
And when they demand attention, give it quick, before they get more demanding. Give it positively. Remember they are learning to share attention too. It's your job to help them learn. Not by telling off or being cross. Teach by giving attention to the skills they are working on. It's social development.