Looks like you are using integrated security which means IIS will use the configured apppool account to connect towards db, not the one you specify in connectionstring.config. Either ensure that the account the apppool is running on has access to the db or turn off integrated security and make sure the account in connectionstring.config has access.
After hosting the application in IIS I am getting the follwing error when i am browsing the first page.
Login failed for user 'XXXXX\YYYYY$'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'XXXXX\YYYYY$'.
Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\ba53f11d\e7fb745a\App_global.asax.mfqw6opx.0.cs Line: 0
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
WebConfig Connection String