Solution 1 (combinatorial)
Let the two disjoint subsets be A and B, and define C=S∖(A∪B) (so C is disjoint from both A and B, and every element of S, if not contained in A or B, is necessarily contained in C). This means every element s∈S satisfies exactly one of s∈A, s∈B, or s∈C, i.e. for each of the 10 elements, we have to independently choose 1 of these 3 subsets into which to place it. Hence there are a total of 310 ways to partition S into disjoint subsets A, B, and C.
However, we must exclude those partitions in which A or B (or both) is empty. If A=∅, and thus S=B∪C, then we have to place each of the 10 elements of S into either B or C, giving 210 such partitions (similarly to above). By symmetry, the case where B=∅ and S=A∪C also gives 210 partitions, so we need to subtract 210 twice from 310. But then the partition A=B=∅,S=C, which falls within both of the above 2 cases, would be double-counted in the subtraction, so we must add it back.
Accordingly, there are (310−2⋅210+1) possible ordered pairs (A,B) (or equivalently, partitions A,B,C). Each pair has 2 possible orders (as A and B, being disjoint, obviously cannot be the same), so the above expression counts each unordered set {A,B} exactly twice. Thus, finally, we deduce that n=21(310−2⋅210+1)=28501≡501(mod1000).
Solution 2 (computational/'bash')
As in Solution 1, let the two disjoint subsets be A and B. We observe that if A has p elements, which can be chosen in (p10) ways, then there are (10−p) remaining elements of S from which to choose the elements of B.
Therefore, letting B have q elements, we must have 1≤q≤10−p, and similarly to above, these q elements can be chosen in (q10−p) ways. Moreover, since A and B must both be non-empty, we require p≥1 and 10−p≥1, i.e. 1≤p≤9. It follows that for each fixed value of p, the number of possible ordered pairs (A,B) is
(p10)q=1∑10−p(q10−p)=(p10)q=1∑10−p(q10−p)1q1(10−p)−q=(p10)(q=0∑10−p(q10−p)1q1(10−p)−q−(010−p)⋅10⋅1(10−p)−0)=(p10)((1+1)10−p−1⋅1⋅1)(by the binomial theorem)=(p10)(210−p−1),
and summing this expression over 1≤p≤9 will therefore give the total number of such ordered pairs.
Just like in Solution 1, counting ordered pairs (A,B) is equivalent to counting each unordered set {A,B} exactly twice, so we deduce
2n=p=1∑9(p10)(210−p−1)=p=1∑9(p10)1p210−p−p=1∑9(p10)1p110−p=(p=0∑10(p10)1p210−p−(010)⋅10⋅210−0−(1010)⋅110⋅210−10)=−(p=0∑10(p10)1p110−p−(010)⋅10⋅110−0−(1010)⋅110⋅110−10)=((1+2)10−1⋅1⋅210−1⋅1⋅1)−((1+1)10−1⋅1⋅1−1⋅1⋅1)=(again by the binomial theorem)=310−210−1−210+1+1=310−2⋅210+1.
Hence, as in Solution 1, n=21(310−2⋅210+1)=28501≡501(mod1000).