Potty training

Hi everyone !

So I am having trouble potty training my little one. He's just recently turned 2. This is our second time attempting. The first time we tried was because he went in the potty himself without even telling us. We just found it in there. This was at like 18 months. After he did it though he was completely scared of the toilet so we held off until now. He was naked all day and we kept encouraging him to go on the potty. He just ended up holding his pee for hours at a time. Literally, he only peed twice today. Both times after running out of the room an slamming the door to hide. I ended up putting a diaper on him because I could tell he had been holding his poop. Low and behold he pooped about 10 minutes after the diaper was put on, but was SUPER upset about it and yelled no whenever we said the word potty. He's had a diaper on ever since and has peed a ton which further proves he was holding it all day. This makes me feel like he's just not ready yet. I was hoping to get some insight on how to KNOW when they are ready. Also any tips would be appreciated. Thank you !!