When he says works are dead and we are not saved by works he means that we are now saved by sacraments.
When he says we are saved he does not mean absolutely but only if we keep the commandments.
When he says that we are justified by faith apart from works. He does not mean by faith alone. He means we are saved by the works of God in the Sacraments.
He does not mean we don't need to keep the commandments either. He means we fulfill the law by faith because love fulfills the law.