The earliest thing they cite is:
> 1642 T. Fuller Holy State iii. xxiii. 218 There is lesse honesty, wisdome, and money in men then is counted on.
it comes from the verb count
count on or count upon means "To make the basis of one's calculations or plans; to look for or expect with assurance; to depend or rely on (in reference to a possible contingency)."