All children are different and some 2 year olds poop more often than others.
It's perfectly normal for a 2 year old to go 3 and even 4 days without pooping depending on the 2 year old's diet.
The more fiber the 2 year old has eaten the more often the 2 year old child should poop and if the child doesn't poop after 4 days and has eaten fiber based foods then the child could be constipated.
You can try giving the 2 year old some prune juice to help get their bowels moving if they haven't pooped in 4 days.
You can also give the 2 year old child some juices such as apple, pear, cherry, grape etc to help with the constipation if the 2 year old is constipated.
If the 2 year old is just holding the poop in and refusing to poop say in the toilet then they will likely poop within a few days to 4 days.
If not and the child seems to be constipated and you've tried several home remedies and the 2 year old is still not pooping then taking the 2 year old child to a doctor would be a good idea to make sure nothing is wrong.