Constipation in guinea pigs is quite uncommon, usually when they're not pooping its because they have not eaten enough to actually produce poops. They need lots of fibre so your best bet is to get hold of some critical care to syringe feed him, although a slurry made from his pellets will do for now, this will hopefully keep his guts moving and stop him going into stasis.
Are you in the UK? If so, please look into PDSA or Blue Cross vets in your area, moving his back teeth oddly could well be a sign of dental issues which will be fatal if not treated by a vet, they will need filing which is not something we can do at home, if not corrected, they will continually grow, over his tongue until his mouth is completely useless and he will sadly starve.
Odd mouth movements can also be something called bruxing, this is done due to pain. When their digestive system starts to slow down, they can get gassy or get stasis which is where the guts stop moving. This is very painful for them. Unfortunately this is also a vet job rather than something that can be fixed at home, especially if he is no longer moving around and becoming lethargic, this would be considered an emergency.
Fingers crossed for him and all the best, I hope he pulls through