But if I live in one and rent one out, the bank only considers me
having rental income of $4000. (The bank doesn't consider my rental
expenses, but if I rent my own house out, the bank considers the extra
income).
Actually they will not credit you with rental income of $4000. They will assume that you will sometimes have months where the property is not rented. They will only estimate that you will get rent 9 of 12 months, so they will asses the average monthly rent received as $3000.
Of course they will know that the mortgage has to be paid each month, along with the taxes and insurance. They also know that you can have other expenses that have to be considered. This may mean that the bank looks at each rental property as a net drain on your finances each month if those properties have loans.
The bank does consider what you pay for the place you live when considering you for the new loan. Every loan application I have seen has a space for your monthly "rent". They then ask if it is rent, or a mortgage payment.