Sharepoint on premise server 2016-Open documents in online mode

I am using sharepoint on premise server 2016.I want to open files in online mode(browser) but while opening all files are getting downloaded.I want to implement this feature to edit documents online.I haven’t activated ‘Open Documents in Client Applications by Default’ feature too.But still it is opening in my local application.How to open files in browser mode to edit it?