I have 2 load balanced WFEs. When I take one of them offline then website still works which means load balancer is working. But when I do IIS reset on one of those machines then the website doesn't work while IIS is resetting. Why is that?
It would help to know what load balancer you are using so I can help narrow the possible cause but the likely reason is detailed below.
If you are using a hardware based load balancer such as F5 LTM then it will load balance traffic across the two nodes on the ports you specify. You will need to setup monitors to probe the health of the nodes and based on the health it will react and route traffic to the other node etc. Typically, these monitors can check if a server is down, the port is down and, if the response time of the node is worse than the other, or if the website is serving a 200 response and much more. The capabilities of your load balancer will determine what these monitors can do for you. If your monitors are simply checking for a Ping on the node then it won't pick up that IIS is down while you do the iisreset and will continue to send that node traffic.
If you are using Windows NLB, you don't get features that allow you to route traffic based on health. The NLB isn't aware of the health of IIS. If the server is up, it'll get traffic. There isn't much more you can configure.
Hope this helps. Let me know if you need me to clarify anything further.
You should refresh the addresses of the service applications. You can use the Start-SPTimerJob in PowerShell
Try using this command via Power Shell: Start-SPTimerJob job-spconnectedserviceapplication-addressesrefresh