Abraham ... justified by works - evidentially, and before men (see on Jam 2:18). In Jam 2:23, James, like Paul, recognizes the Scripture truth, that it was his faith that was counted to Abraham for righteousness in his justification before God.
when he had offered - rather, “when he offered” [Alford], that is, brought as an offering at the altar; not implying that he actually offered him.