I am not totally clear on what you are describing.
If you are seeing tissue that appears to be sticking out of the anus, that could be a rectal prolapse and that is something that should be seen by a vet as soon as possible. If the exposed tissue dries out or he licks or chews at it, it can become much more difficult to repair.
If you are saying that the anus itself is swollen and red, but does not have anything sticking out of it, then that is probably jsut some irritation from the stool and/or shampoo. You can rinse it off again using just cool water and apply some hydrocortisone cream to the area.
If the bulge around the anus is to one side or the other, this is most likely anal glands that need to be expressed. If there is a hole over this swelling (separate from the anus), it means that the anal gland has ruptured. If this is the case, your dog will need some antibiotics so he will need to be seen by a vet. In the meantime, you can keep the area clean by having him sit in a tub of water.
If none of these seem to be exactly what you are describing, try again to explain again exactly what you are seeing.
Please let me know if you have additional questions.
Many dogs with long hair have trouble with getting stool caught in the hair - it is a good idea to keep that area trimmed short to help prevent this problem in the future.