Start with reading the manual, ranking is explained in great detail there http://www.amibroker.com/guide/h_portfolio.html
By the way, reading Tutorial section http://www.amibroker.com/guide/tutorial.html answers 99.99% of questions you would ever have. All the information is on the plate in the docs.
After reading the manual, you can check dozens of already existing threads covering ranking by using FORUM SEARCH