My 2 year old used to tell me he needs to go to bathroom in beginning then he stop why did he stopped help
I'll just throw in that we also had such backslide during potty training and from what I understand it's super common. I think an initial success can often be explained by the fact that the potty training itself is still novel and interesting to the child. It's one thing to be conscious that you need to go when you're constantly thinking about it. As the child tries to automate the behavior and turn it into an acquired ability that requires no conscious thought, a period of many accidents is unsurprising.
Is he hiding when he poops/pees?
About 74% of children who struggle to potty train have been found to hide when they poop (Schonwald et al., Factors Associated with Difficult Toilet Training, Jun 2004). This behavior can occur before, during, or after potty training. It is hypothesised to be to do with the child feeling embarrassed (Klassen et al., The Effectiveness of Different Methods of Toilet Training for Bowel and Bladder Control, Dec 2006). Many children do not see, or hear about, other people going for a poo. I have heard anecdotes of children who though they were the only ones who pooped, but more common is the fact that children pick up on the fact that adults poo in private, so think they should do the same.
Although it may seem weird, the solution to this is to help him realise that there is nothing to be ashamed of. It might be helpful to announce when you are going to the toilet (and say which you will be doing) and to leave the door open or pushed closed so that he could open it. Additionally, keep anyone who is squeamish about human waste (likely older children) away when he is using the potty or having an accident cleaned up. If you or another caregiver has negative reactions to it, such as wrinkling your nose, try your best to avoid this.