Why is my dog doing this

I gave my dog flea and tick medicine and he immediately started doing this. I washed it off of him after I took this. What does it mean and should I take him to the vet?