This depends on the species the box is intended for. Boxes for tits, sparrows or starlings should be fixed two to four metres up a tree or a wall.
Unless there are trees or buildings which shade the box during the day, face the box between north and east, thus avoiding strong sunlight and the wettest winds.
Make sure that the birds have a clear flight path to the nest without any clutter directly in front of the entrance. Tilt the box forward slightly so that any driving rain will hit the roof and bounce clear.
House sparrows and starlings will readily use nest boxes placed high up under the eaves. Since these birds nest in loose colonies, two or three can be sited spaced out on the same side of the house. Keep these away from areas where house martins normally nest.
Open-fronted boxes for robins (like the above) and wrens need to be low down, below 2m, well hidden in vegetation. Those for spotted flycatchers need to be 2-4m high, sheltered by vegetation but with a clear outlook. Woodpecker boxes need to be 3-5m high on a tree trunk with a clear flight path and away from disturbance.
Fixing your nest box with nails may damage the tree. It is better to attach it either with a nylon bolt or with wire around the trunk or branch. Use a piece of hose or section of car tyre around the wire to prevent damage to the tree. Remember that trees grow in girth as well as height, and check the fixing every two or three years.
Two boxes close together may be occupied by the same species if they are at the edge of adjoining territories and there is plenty of natural food. While this readily happens in the countryside, it is rare in gardens, where you normally can only expect one nesting pair of any one species. The exceptions to this are house and tree sparrows and house martins, which are colonial nesters. By putting up different boxes, several species can be attracted.
Nest boxes are best put up during the autumn. Many birds will enter nest boxes during the autumn and winter, looking for a suitable place to roost or perhaps to feed. They often use the same boxes for nesting the following spring. Tits will not seriously investigate nesting sites until February or March.