They are two different conditions, although they both have similar effects - difficulty controlling blood sugar levels and potentially harmful complications. If you are Type 1 you need insulin from the word go because you no longer produce enough of your own, whereas Type2 can be producing lots of insulin but not using it properly (insulin resistance). Generally, a Type 2 on insulin will need much higher doses than a Type 1 because of the insulin resistance.
They can test to see how much of your own insulin you are making (C--peptide) and also if you have antibodies suggesting your immune system has attacked the beta cells of your pancreas.
Having said all that, nothing is ever simple, and some Type1s also have insulin resistance, and some Type 2s only need small doses of insulin. And some people are slow-onset Type1, also called Type 1.5 or LADA (Latent Autoimmune Diabetes in Adulthood)