You must completely ignore your dog (do not look at him, talk to him or touch him) until he is completely quiet for 2-3 seconds.
After he is quiet you praise him and give him attention.
If he barks again, you ignore again.
Slowly you increase the time the dog remains quiet before you give him attention.