I am sorry to hear about this concern.
Well, if you see a wound "next to" his rectum, it is quite possibly (as a guess only and not based on examination) a ruptured anal gland.
There are glands, just inside the rectum, that produce a liquid substance when a dog defecates. Sometimes, these glands get impacted and can rupture creating a draining wound next to the rectum.
Even if you can't afford testing at a vet, still get to a vet.
Many vets offer a courtesy examination to new clients. Take advantage of it. It is likely the gland needs to get flushed out and he get started on some basic antibiotics and anti-inflammatory medication. The cost to treat could be kept minimal, but don't assume you can't afford the visit. Remember, you can decline whatever you can't do. But, you need the diagnosis and the exam in order to get the medications.
Hope that information helps