A declaration of trust states the way the property is owned.
When two people buy a house together it can be owned as joint tenants or tenants in common.
If it is owned as joint tenants then both own the whole. A strange concept, but it means that when one dies the other automatically becomes sole owner. The house is owned by AB.
If it is held as tenants in common, each owns a 'share' - not necessarily 50%. On death, that share can be willed to another - it forms part of the estate. The house is owned by A and B.
The solicitor will sort this out for you when you purchase the property.
A declaration of trust is usually required when one person already owns the house, but adds another name to the deeds, or title register. It specifies how the property is owned, and how the profits shall be divided on sale or death.