Try finding the largest uptime for each sid.
SELECT MAX(uptime) AS max_uptime,
sid
FROM stats
GROUP BY sid
Then, join that virtual table to the other stuff.
SELECT whatever, whatever
FROM (
SELECT MAX(uptime) AS max_uptime,
sid
FROM stats
GROUP BY sid
) AS s
JOIN servers ON s.sid = servers.sid
JOIN os ON servers.os AS os.oid
ORDER BY max_uptime DESC
The trick here is to summarize (aggregate) the stats table before joining it to the other tables.
Pro tip: don't use SELECT * in software. Especially don't use it when you're trying to explain what you need in your result set.