How to restore Macbook Air to factory settings? I am not a pro-Mac user (I am a Windows user) 

Here's what I did with my old Macbook Air,


Press COMMAND + R while booting and it went into the mode shown in the picture
Selected Macintosh HD to (hopefully) install Mac OS X again
Entered Apple ID credentials


However, upon logging in, a message box shows saying that the Apple ID has not been used with App Store then the install won't proceed. 

What can be done to format the Macbook Air into factory settings.
Your answer is right there in your last line, "format the MacBook Air..." Or more correctly format the hard drive.

When you boot into Recovery Mode you should be given the option to launch Disk Utility. Do that, go into Disk Utility, select the Macintosh HD volume/partition and format it.

Once there is nothing on the internal drive it should allow you to install macOS and there should be no conflict with the credentials previously used.

If you have not established an AppleID and logged into the App Store before you may need to do this once. It will likely want a payment method (credit card) but downloading and installing macOS is free. You should be able to do this in iTunes on your MacBook Air before you do the whole reformat then reinstall routine.