My dog

My dog poops and pees all over my house. To date I have thrown away countless blankets, and beds for him. He’ll go outside but his last event he literally overflowed his bed. He goes out close to every two hours except for at night. When I go to bed he literally pees everywhere! He doesn’t have any medical conditions. Im at a loss at this point. Im now thinking of rehoming. He was a rescue and was abused he bites the crap outta me and really doesn’t like to be pet too much. I don’t know what to do. I’m just tired of constantly cleaning up after him. Any advice would be great!