Hmm good question, without thinking about it too much (from best to worst):
Resident Evil 4
Resident Evil (Remake)
Resident Evil 7
Resident Evil 8: Village
Resident Evil 2 (Remake)
Resident Evil 2
Resident Evil Zero
Code Veronica
Resident Evil 5
Resident Evil 3
Resident Evil 3 (Remake)
Resident Evil 6
*****
It’s hard to rank them as they are good for different reasons, which can simply be ‘gameplay’, ‘story (serious or cheesy)’, ‘atmosphere’, ‘how unnerving it is’, ‘humour’ etc. Or for one off reasons - I had a great time playing RE5 on co-op with my wife.
Re:make has a great atmosphere, Re7 is terrifying. Re:8 blends Re7 with Re4 fairly well. The original RE2 and Code Veronica are fun in their own way but also very dated, if you go back and play them. RE2 original is really short.
Overall though - I would say that RE4 is the best as a whole. The settings, treasure hunting, action, variety of environments and creepy sections make it the best ‘overall game’.