To potty train an 8 year old boy you basically do the same thing as you would with a younger kid who is potty training.
However it also depends on why the 8 year old is not potty trained.
If the 8 year old boy has health issues or mental disabilities or autism it can make it more difficult to potty train the 8 year old boy.
If the 8 year old boy has autism then they may never be able to be potty trained and may need diapers all the time.
However if the 8 year old boy has no other health issues or autism or less severe autism then just trying to keep potty training them can result in the kid being potty trained.
If you want to potty train the 8 year old boy you should put them in underwear and then set a timer and then take them to the potty during the times they are about to poop or pee.
If they have accidents then just help them clean up the pee or poop and help them get cleaned up or if they can clean themselves up just allow them to clean themselves up.
Don't scold them but just tell them that it's okay and that they will likely do better next time.
At 8 years old though it can usually be easy to potty train the kid unless they have other health issues that prevent it.