If possible, it would be better to hang the bird houses from limbs using light chain or bailing wire. Route the wire/chain through a piece of rubber hose before looping it loosely (to allow for growth) around the limb.
If nailing is your only option, you should use a galvanized nail, or preferably a galvanized screw (which will allow you to take the house down for cleaning).
To allow for the growth of the tree, you can slide a short, stiff spring sandwiched between 2 flat washers over the nail/screw and only drive the nail/screw in until it begins to compress the spring.
You should NEVER drive a copper nail or screw into a tree under any circumstance, unless your intent is to kill the tree!
_________________________
The Gnome