sold an iphone 5s, buyer is saying I didn't wipe and needs my 4 digit passcode
He can wipe it without your passcode, provided it is not locked to your iCloud account, which by the sounds of it, it's not. 

This can be done by connecting the phone to iTunes and then putting it in recovery mode. Quoting from Apple website page here.


Connect device to iTunes.
Put in recovery mode: Press and hold the Sleep/Wake and Home buttons at the same time. Don't release when you see the Apple logo. Keep holding both buttons until you see the recovery mode screen.
When you see the option to Restore or Update, choose Restore. 


iTunes will download software for the device. If it takes more than 15 minutes, your device will exit recovery mode and you'll need to repeat steps 2 and 3.

Once done, the device can be set up and used as normal.