Sudan's army chief has declared Khartoum is "free" and that his forces have retaken the capital after nearly two years of fighting.