I bought a phone from someone, and while uploading photos it's uploading them to their OneDrive. How do I change it so photos are uploaded to my OneDrive?
Windows Phone / Windows 10 Mobile requires that you're signed in with a Microsoft Account in order to anything really useful (syncing/email accounts/etc). The fact that the last owner has auto OneDrive upload enabled means they are still signed in on that device.
You should remove that person's account from the phone immediately because they can track you by signing into their online account. The last owner should have done this before selling you the device, because you can also see their account info as well.
In order to remove the root Microsoft Account, you will need to do a reset so you can use your Microsoft Account for the phone. The last owner should have
You can do this from the Settings > About, but I strongly recommend using the Windows Phone Recovery Tool. As a bonus, you'll get the latest firmware and OS build available for your device.