The requirements of search engines for a good ranking for your web site vary in detail from each other, and are subject to revision whenever the search organisation sees a reason to do so. There are a few rules which are more or less universal, however.
One of the major criteria for high ranking is recommendation, as judged by the number of backlinks from sites which themselves are highly ranked by that search company or others. Unfortunately links from your site to theirs - though it is courtesy, and usually a requirement - score zero points. Some sites provide links by no more than a page listing, but I regard a small item telling visitors about the linked site, and placed in a position relevant to it, as an obligation.
The objective of any search company is to provide its clients with the most relevant and up-to-date data with regard to the search terms entered. Titling, page content and even file naming need to be well matched, with plenty of relevant key words and phrases, but without "spamming" - stuffing the page with useless repetition. Note, too that "up-to-date" is itself a criterion. Your site might have been number one 4 weeks ago, but if an otherwise equal site for that search term appears today then it will displace yours tomorrow, the lesson being to frequently and regularly update and revise your own.
Some search engines look at "meta statements", which are information carried in HTML files, but which do not affect what is displayed in the visitor's browser. In this context two meta types are relevant: firstly a description of the web page, which is often the statement about the page given in search engine results, and secondly a list of key words and phrases which the author judges to be most relevant to that page. As you might guess meta statements must accurately reflect actual page content, and search companies will reduce your score for non-compliance.
Page titles, domain names and page file names which reflect the site's content can also improve ranking.
You can download Google's search engine starter guide from this site by clicking here (a pdf format document).