You’ll get a free copy on Windows 10 if you buy it on Xbox One. And vice versa.

It was confirmed by Phil Spencer (Head of Xbox) himself:

Resident Evil 7 is now one of the first titles not being published by Microsoft and belonging to Xbox Play Anywhere. Basically, everyone who buys a copy on Windows 10 can play the game on Xbox One. It’s the same the other way round, when a user pays for a digital copy on the console.

You should remember that Steam (and generally other copies other than the ones from Microsoft Store) are not eligible for the Xbox Play Anywhere offer. Resident Evil 7 Biohazard releases next week on January 24th.