Are they screaming out of pain, anger, excitement, etc?

With a child under 2, I usually place them in their playpen for a bit when they are doing something I don't want them doing. I put them in their and say "we do not ___. I will come and get you in a few minutes." Then when I take them out, I say again "we do not ____. I want you to play nice with your friends now."

Then I just keep repeating for as long as needed. Whatever you decide to do, just be consistent so you don't send mixed messages.