There are big difference between “这里 的 天气跟 我 老家 一样” and “这里 的 天气跟 我 老家 的 一样”
“这里 的 天气 跟 我 老家 一样” = The weather here is like my hometown
“这里 的 天气 跟 我 老家的 一样” = The weather here is like my hometown's (weather)
In example #1, it compare 'this place's weather' to 'my home town', meaning the (weather) here is the same as my (home town), which is nonsensical
In example #2, it compare 'this place's weather' to 'my home town's weather' with 'weather' omitted (It is like in English, we could say "let's go to Howard's" instead of "let's go to Howard's home")
If the sentence was 这里 跟 我 老家 一样 (this place is like my hometown) you are comparing 这里(this place) with 我老家(my hometown), that make complete sense.
Basically, the possessive "的“ after a comparative '和/跟' or '比' cannot be omitted. But you can omit the second noun if it is the same as the first one
For example:
"我的房子比你的房子大" (my house is bigger than your house) can be reduced to "我的房子比你的大" (omit the repeated noun 房子)
If the second noun is different from the first one, then it can't be omitted
Example:
我的手臂比你的大腿粗 (My arm is thicker than your thigh)
The second noun is different from the first noun, therefore, it can't be omitted
There are two kinds of possessive
true possessive like "my car" (you own the car)
relative possessive like "my mother", "my country" (you don't own your mother or your country)
If it is relative possessive, you can omit it altogether
Example:
这里(的)天气 和 我(的)老家(的)天气一样
我(的)媽媽 跟 你(的)媽媽老媽媽 一般大年紀