From Wikipedia

The oldest standing house in Northern Europe is at Knap of Howar, dating from 3500 BC (see also image)
The history of Scotland begins around 14,000 years ago, when humans first began to inhabit what is now Scotland after the end of the Devensian glaciation, the last ice age. Of the Stone Age, Bronze Age, and Iron Age civilization that existed in the territory, many artifacts remain, but few written records were left behind.
The recorded history of Scotland begins with the arrival of the Roman Empire in Britain, when the Romans occupied what is now broadly England and Wales and the Scottish Lowlands, administering it as a Roman province called Britannia. To the north was territory not governed by the Romans — Caledonia, by name. Its people were the Picts. From a classical historical viewpoint Scotland seemed a peripheral country, slow to gain advances filtering out from the Mediterranean fount of civilisation, but as knowledge of the past increases it has become apparent that some developments were earlier and more advanced than previously thought, and that the seaways were very important to Scottish history.
Because of the geographical orientation of Scotland and its strong reliance on trade routes by sea, the kingdom held close links in the south and east with the Baltic countries, and through Ireland with France and the continent of Europe. Following the Acts of Union which united Scotland with England into the Kingdom of Great Britain, and the subsequent Scottish Enlightenment and Industrial Revolution, Scotland became one of the commercial, intellectual and industrial powerhouses of Europe. Its industrial decline following the Second World War was particularly acute, but in recent decades the country has enjoyed something of a cultural and economic renaissance, fuelled in part by a resurgent financial services sector, the proceeds of North Sea oil and gas, and latterly a devolved parliament.
People lived in Scotland for at least 8,500 years before recorded history dealt with Britain. At times during the last interglacial period (130,000 – 70,000 BC) Europe had a climate warmer than today's, and early humans may have made their way to Scotland, though archaeologists have found no traces of this. Glaciers then scoured their way across most of Britain, and only after the ice retreated did Scotland again become habitable, around 9600 BC.
Mesolithic hunter-gatherer encampments formed the first known settlements, and archaeologists have dated an encampment near Biggar to around 8500 BC. Numerous other sites found around Scotland build up a picture of highly mobile boat-using people making tools from bone, stone and antlers.

In 3000 BC, some Neolithic farmers lived in stone houses (such as those at Skara Brae) set into existing middens
Neolithic farming brought permanent settlements, and the wonderfully well-preserved stone house at Knap of Howar on Papa Westray dating from 3500 BC predates by about 500 years the village of similar houses at Skara Brae on West Mainland, Orkney. The settlers introduced chambered cairn tombs from around 3500 BC (Maeshowe offers a prime example), and from about 3000 BC the many standing stones and circles such as the Ring of Brodgar on Orkney and Callanish on Lewis. These form part of the Europe-wide Megalithic culture which also produced Stonehenge in Wiltshire, and which pre-historians now interpret as showing sophisticated use of astronomical observations.
The cairns and Megalithic monuments continued into the Bronze age, and hill forts started to appear, such as Eildon Hill near Melrose in the Scottish Borders, which goes back to around 1000 BC and which accommodated several hundred houses on a fortified hilltop.
Brythonic Celtic culture and language spread into Scotland at some time after the 8th century BC, possibly through cultural contact rather than through mass invasion, and systems of kingdoms developed.
From around 700 BC the Iron age brought numerous hill forts, brochs and fortified settlements which support the image of quarrelsome tribes and petty kingdoms later recorded by the Romans, though evidence that at times occupants neglected the defences might suggest that symbolic power had as much significance as warfare.