First take it to the vet to make sure it's healthy physically. Make sure you clean the spot on the floor where your cat is peeing with an enzyme cleaner.
If you have a room or small area you can put it in then place a litter box inside there. If your cat has not used the bathroom for awhile put it in there with the litter box.