Jury convicts man of home invasion in attack on ex-girlfriend