Like past Samsung smartphones, the Galaxy S8 and S8+ are IP68 dust and water resistant. That's a higher rating than the iPhone 7, which means you can practically go swimming with the phone. Although we wouldn't recommend it.
The IP68 rating means it's both dust, splash and water resistant. Technically users can submerge the Galaxy S8 in around 5ft of water for up to 30 minutes. It will work fine after-wards. Again, Samsung doesn't recommend fully getting it under water, but rest easy knowing accidents can happen and the phone won't die.