You got a home equity loan to purchase another home if the first home forecloses how does that effect the second home?

It depends--if the 2d home is included in the deed of trust then it, too is foreclosed. If it is not included, then the 2d home is free and clear.