Depends. You can sort them by each of those. It's very easy to do in PHP. For example, on this page it is sorted by views: http://www.youtube.com/browse?s=mp However, on this page, it is sorted by subscriptions: http://www.youtube.com/members?s=ms&t=m&g=0
Are we talking about Youtube search rankings? For the default search rankings, there are a lot of variables that come into play. The most significant ones however, is the view count and age of the video. Generally speaking, videos with higher view counts that have been around for a while will rank higher for their designated keywords
Videos are ranked by Views, Comments, and Ratings. Users are ranked by Total Video Views and Subscriptions.