Its a compound sentence because "John went to school today" is an independent cluase, as well as "James remained at home." They both express a complete thought.The sentencehas 2 independent clauses seperated by a ", FANBOY". Compound sentences have 3ways to join the 2 independent clauses, one of them being " , FANBOY", in this case the FANBOY is "but".